redis mysql nginx的docker-compose
version: '3'services:nginx:image: docker.m.daocloud.io/nginx:latestcontainer_name: nginxrestart: unless-stoppedenvironment:TZ: Asia/ShanghaiLANG: en_US.UTF-8volumes: # 目录映射(宿主机:容器内)- "./nginx/conf/nginx.conf:/etc/nginx/nginx.conf"- "./nginx/log:/var/log/nginx"- "./nginx/html:/usr/share/nginx/html"ports:- "80:80"- "443:443"networks:my-network:ipv4_address: 172.16.0.100depends_on:- redis- mysqlredis:container_name: redisrestart: unless-stoppedimage: docker.m.daocloud.io/redis ports:- "6379:6379"command: redis-server /etc/redis/redis.confvolumes:- "./redis/data:/data"- "./redis/conf/redis.conf:/etc/redis/redis.conf"networks:my-network:ipv4_address: 172.16.0.101mysql:image: docker.m.daocloud.io/mysql:8.0container_name: mysqlenvironment:- MYSQL_ROOT_PASSWORD=root@321restart: unless-stoppedports:- "3306:3306"volumes:- "./mysql/data:/var/lib/mysql"networks:my-network:ipv4_address: 172.16.0.102networks:my-network:ipam:driver: defaultconfig:- subnet: 172.16.0.0/24gateway: 172.16.0.1