Files
CapacityReport/build/docker-compose.yml
T
2026-01-15 15:59:38 +08:00

80 lines
2.0 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.
# CapacityReport Docker 编排文件
# 用于内网离线部署
#
# 使用方法:
# sh deploy.sh # 一键导入镜像并启动服务
# docker-compose up -d # 启动所有服务
# docker-compose down # 停止所有服务
version: '3.8'
services:
# 容量报表应用
capacity-app:
image: capacity-report-app:latest
container_name: capacity-report-app
restart: unless-stopped
ports:
- "19081:9081"
volumes:
# 持久化数据
- ./cache:/app/cache
- ./Configure.json:/app/Configure.json
- ./ReportScript.sql:/app/ReportScript.sql
# 日志目录
- ./logs:/var/log/supervisor
environment:
- TZ=Asia/Shanghai
- PYTHONUNBUFFERED=1
- SUPERVISOR_ENABLED=1
depends_on:
capacity-mysql:
condition: service_healthy
networks:
- capacity-network
# MySQL 数据库
capacity-mysql:
image: capacity-mysql:8.0.44
container_name: capacity-mysql
restart: unless-stopped
ports:
- "13306:3306"
volumes:
# 数据持久化
- capacity-mysql-data:/var/lib/mysql
# 自定义配置(启用 LOAD DATA INFILE)
- ./mysql/conf.d:/etc/mysql/conf.d:ro
# 初始化脚本(仅在首次启动时执行)
- ./mysql/init:/docker-entrypoint-initdb.d:ro
environment:
- TZ=Asia/Shanghai
- MYSQL_ROOT_PASSWORD=gmcc123
- MYSQL_DATABASE=CapacityReport
command:
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_unicode_ci
- --local-infile=ON
- --secure-file-priv=
- --max_allowed_packet=256M
- --innodb_buffer_pool_size=512M
- --innodb_log_file_size=128M
- --innodb_flush_log_at_trx_commit=2
- --sync_binlog=0
networks:
- capacity-network
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-pgmcc123"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
networks:
capacity-network:
driver: bridge
volumes:
capacity-mysql-data:
driver: local