services:
  php:
    image: php:7.4-fpm-alpine
    volumes:
      - ./www:/usr/share/nginx/html
    # 新增安装mysqli扩展
    command: >
      sh -c "docker-php-ext-install mysqli && docker-php-ext-enable mysqli && php-fpm"
  nginx:
    image: nginx:stable-alpine
    ports:
      - "8080:80"
    volumes:
      - ./nginx/default.conf:/etc/nginx/conf.d/default.conf
      - ./www:/usr/share/nginx/html
    depends_on:
      - php
