docker-compose.yml


nginx:
  image: nginx:1.17
  ports:
    - "80:80"
    - "443:443"
  volumes:
    - ./www/:/var/www/html/:rw
    - ./conf/nginx/conf.d:/etc/nginx/conf.d/:ro
    - ./conf/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
    - ./log/nginx/:/var/log/nginx/:rw
  links:
    - php-fpm:fpm

php-fpm:
  image: php:7.2-fpm
  expose:
    - "9000"
  volumes:
    - ./www/:/var/www/html/:rw
    - ./conf/php/php.ini:/usr/local/etc/php/php.ini:ro
    - ./conf/php/php-fpm.d/www.conf:/usr/local/etc/php-fpm.d/www.conf:rw
    - ./log/php-fpm/:/var/log/php-fpm/:rw
  stdin_open: true
  tty: true
  links:
    - mysql:mysql
    - redis:redis

mysql:
  image: mysql:5.7
  ports:
    - "3306:3306"
  volumes:
    - ./conf/mysql/my.cnf:/etc/mysql/my.cnf:ro
    - ./mysql/:/var/lib/mysql/:rw
    - ./log/mysql/:/var/log/mysql/:rw
  environment:
    MYSQL_ROOT_PASSWORD: "123456"

redis:
  image: redis:5.0
  ports:
    - "6379:6379"


^