docker-compose.yaml
version: "2"
services:
ngix1:
image: nginx
container_name: nginx
ports:
- 8080:80
volumes:
- /mydata/nginx/html:/usr/share/nginx/html
- /mydata/nginx/conf/nginx.conf:/etc/nginx/nginx.conf
- /mydata/nginx/logs:/var/log/nginx
db:
image: mysql:5.7
container_name: mysql
ports:
- "3306:3306"
volumes:
- /mydata/mysql/log:/var/log/mysql
- /mydata/mysql/data:/var/lib/mysql
- /mydata/mysql/conf:/etc/mysql
environment:
- MYSQL_ROOT_PASSWORD=939603
redis:
image: redis
container_name: redis
ports:
- "6379:6379"
restart: always
volumes:
- /mydata/redis/data:/data
- /mydata/redis/conf/redis.conf:/etc/redis/redis.conf
command:
redis-server /etc/redis/redis.conf