我已生成带有必要图像的docker yml文件。我将index.php放置在nginx所需的当前目录中以显示页面,并且当我运行docker-compose up命令时,在容器中的/ application目录中未检测到我的工作目录中的文件。
version: "2"
services:
memcached:
image: memcached:alpine
container_name: juzpay-docker-memcached
mysql:
image: mysql:8.0
container_name: juzpay-docker-mysql
working_dir: /application
volumes:
- .:/application
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=juzpay_db
- MYSQL_USER=root
- MYSQL_PASSWORD=root123
ports:
- "8082:3306"
webserver:
image: nginx:alpine
container_name: juzpay-docker-webserver
working_dir: /application
volumes:
- ./dockerapp:/application
- ./phpdocker/nginx/nginx.conf:/etc/nginx/conf.d/default.conf
ports:
- "8080:80"
php-fpm:
build: phpdocker/php-fpm
container_name: juzpay-docker-php-fpm
working_dir: /application
volumes:
- ./dockerapp:/application
- ./phpdocker/php-fpm/php-ini-overrides.ini:/etc/php/7.2/fpm/conf.d/99-overrides.ini