最终版本 docker-compose.yml 文件:
version: "3"
services:
nginx:
image: nginx:latest
ports:
- '80:80'
- '443:443'
depends_on:
- redis
volumes:
- ./www:/www
- ./conf/nginx.conf:/etc/nginx/nginx.conf
links:
- wordpress
- redis
- mysql
restart: always
redis:
image: redis
restart: always
volumes:
- ./conf/redis.conf:/etc/redis/redis.conf
command: redis-server /etc/redis/redis.conf
wordpress:
image: wordpress:php7.1-fpm
volumes:
- ./www:/www
- ./conf/www.conf:/usr/local/etc/php-fpm.d/www.conf
depends_on:
- redis
- mysql
links:
- redis
- mysql
restart: always
mysql:
image: mariadb
volumes:
- ./db-data:/var/lib/mysql
- ./conf/my.cnf:/etc/mysql/my.cnf
environment:
- MYSQL_ROOT_PASSWORD=Appinn
restart: always
phpmyadmin:
image: phpmyadmin/phpmyadmin
ports:
- "8080:80"
links:
- mysql
environment:
PMA_HOST: mysql