program/docker-compose.yml

66 lines
1.4 KiB
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.

version: '3.8'
services:
mining-system:
build:
context: .
dockerfile: Dockerfile
container_name: mining-system
restart: unless-stopped
ports:
- "5000:5000"
env_file:
- .env
environment:
- DB_HOST=${DB_HOST}
- DB_PORT=${DB_PORT}
- DB_USER=${DB_USER}
- DB_PASSWORD=${DB_PASSWORD}
- DB_NAME=${DB_NAME}
- DEFAULT_AI_MODEL=${DEFAULT_AI_MODEL:-qwen}
- SECRET_KEY=${SECRET_KEY:-mining-system-secret-key-2024}
volumes:
# 标签名称目录映射
- ./name:/name
# 日志目录
- ./logs:/app/logs
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5000/"]
interval: 30s
timeout: 5s
retries: 3
start_period: 15s
networks:
- mining-network
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
# Nginx反向代理
nginx:
image: nginx:alpine
container_name: mining-nginx
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx-docker.conf:/etc/nginx/conf.d/default.conf:ro
# SSL证书如使用HTTPS取消注释
# - ./ssl:/etc/nginx/ssl:ro
depends_on:
mining-system:
condition: service_healthy
networks:
- mining-network
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
networks:
mining-network:
driver: bridge