Files
DDUp/docker-compose.prod.yml

34 lines
871 B
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 生产环境 Docker Compose 配置
# 使用方式: docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d
services:
mysql:
# 仅绑定 127.0.0.1供本机连接SSH 登入后 mysql -h 127.0.0.1 -P 3399
# 不暴露到公网;若无需外连可改为 ports: []
# 使用宿主机目录存储数据,便于备份
volumes:
- /opt/vitals/mysql_data:/var/lib/mysql
vitals:
env_file:
- .env.production
environment:
# 生产环境标识
- ENVIRONMENT=production
restart: always
# 生产环境日志配置
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
# 资源限制(可选)
deploy:
resources:
limits:
cpus: '1'
memory: 512M
reservations:
cpus: '0.25'
memory: 128M