docker-compose内容,用的是https://github.com/yeszao/dnmp
version: "3"
services:
nginx:
build: ./nginx/build/
ports:
- "80:80"
- "443:443"
volumes:
- /data/wwwroot/:/data/wwwroot/:rw
- ./nginx/conf/conf.d:/etc/nginx/conf.d/:ro
- ./nginx/conf/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/log/:/var/log/dnmp/:rw
restart: always
networks:
- net-php
php72:
build: ./php72/build/
expose:
- "9000"
volumes:
- /data/wwwroot/:/data/wwwroot/:rw
- ./php72/conf/php.ini:/usr/local/etc/php/php.ini:ro
- ./php72/conf/php-fpm.conf:/usr/local/etc/php-fpm.d/www.conf:rw
- ./php72/log/:/var/log/dnmp/:rw
restart: always
networks:
- net-php
- net-mysql
- net-redis
mysql8:
image: mysql:8.0
ports:
- "3306:3306"
volumes:
- ./mysql8/conf/mysql.cnf:/etc/mysql/conf.d/mysql.cnf:ro
- ./mysql8/data/:/var/lib/mysql/:rw
restart: always
networks:
- net-mysql
environment:
MYSQL_ROOT_PASSWORD: "10079894"
# redis:
# image: redis:4.0
# restart: always
# networks:
# - net-redis
# ports:
# - "6379:6379"
#
# phpmyadmin:
# image: phpmyadmin/phpmyadmin:latest
# ports:
# - "8080:80"
# networks:
# - net-mysql
# environment:
# - PMA_HOST=mysql
# - PMA_PORT=3306
#
# phpredisadmin:
# image: erikdubbelboer/phpredisadmin:latest
# ports:
# - "8081:80"
# networks:
# - net-redis
# environment:
# - REDIS_1_HOST=redis
# - REDIS_1_PORT=6379
networks:
net-php:
net-mysql:
net-redis: