version: “1.0.0”
networks: #添加网络
web-net:
driver: bridge
services:
php-fpm-1:
image: php:7.4-fpm
container_name: php-fpm-1
privileged: true
ports:
- “9001:9000”
volumes:
- /home/www:/www
- /home/conf/php7.4/etc:/usr/local/etc
- /home/log/php7.4:/var/log
networks:
- web-net
php5.6:
image: php:5.6.40-fpm
container_name: php5.6
privileged: true
ports:
- “9002:9000”
volumes:
- /home/www:/www
- /home/conf/php5.6/etc:/usr/local/etc
- /home/log/php5.6:/var/log
networks:
- web-net
nginx:
image: nginx
container_name: php-nginx
privileged: true
ports:
- “80:80”
- “8000:8000”
- “8001:8001”
- “8002:8002”
- “8003:8003”
- “8004:8004”
- “8005:8005”
volumes:
- /home/www/:/www
- /home/log/nginx:/var/log/nginx
- /home/conf/nginx/conf.d:/etc/nginx/conf.d
networks:
- web-net
restart: always
links:
- php-fpm-1:php7.4
- php5.6:php5.6
mysql:
image: mysql:5.7
container_name: php-mysql
privileged: true
ports:
- “3306:3306”
volumes:
- /home/data/mysql5.7:/var/lib/mysql
- /home/conf/mysql5.7:/etc/mysql/conf.d
- /home/log/mysql5.7:/var/log
environment:
- MYSQL_ROOT_PASSWORD=123456
networks:
- web-net
redis:
image: redis:3.0
container_name: php-redis-master
privileged: true
ports:
- “6379:6379”
volumes:
- /home/conf/redis/redis-master/myredis.conf:/etc/redis/redis.conf
- /home/data/redis/redis-master:/data
networks:
- web-net
restart: always
command: redis-server /etc/redis/redis.conf
docker-compose.yml
最新推荐文章于 2024-09-12 08:49:17 发布