mirror of
https://github.com/yyhuni/xingrin.git
synced 2026-02-17 20:03:38 +08:00
- 新增logger模块,提供基于zap的日志管理 - agent主程序及内部模块改为使用zap日志记录信息和错误 - agent内部关键事件增加详细日志输出 - 配置日志级别和环境变量控制日志格式和输出 - websocket和task客户端启用TLS跳过验证并记录连接日志 - 任务接收、取消和配置更新过程中增加结构化日志记录 - 更新过程中添加panic捕获日志及状态更新 - 移除.vscode/settings.json配置文件 - 更新Dockerfile基础镜像版本和环境变量 - .gitignore添加SSL证书相关忽略规则 - 调整Go模块依赖,新增多个日志和相关库依赖
87 lines
2.1 KiB
YAML
87 lines
2.1 KiB
YAML
# ============================================
|
||
# 生产环境配置 - 使用 Docker Hub 预构建镜像
|
||
# ============================================
|
||
|
||
services:
|
||
# PostgreSQL(可选,使用远程数据库时不启动)
|
||
postgres:
|
||
profiles: ["local-db"]
|
||
image: postgres:16.3-alpine
|
||
restart: always
|
||
environment:
|
||
POSTGRES_DB: ${DB_NAME}
|
||
POSTGRES_USER: ${DB_USER}
|
||
POSTGRES_PASSWORD: ${DB_PASSWORD}
|
||
volumes:
|
||
- postgres_data:/var/lib/postgresql/data
|
||
ports:
|
||
- "${DB_PORT}:5432"
|
||
healthcheck:
|
||
test: ["CMD-SHELL", "pg_isready -U ${DB_USER}"]
|
||
interval: 5s
|
||
timeout: 5s
|
||
retries: 5
|
||
|
||
redis:
|
||
image: redis:7.4.7-alpine
|
||
restart: always
|
||
healthcheck:
|
||
test: ["CMD", "redis-cli", "ping"]
|
||
interval: 5s
|
||
timeout: 5s
|
||
retries: 5
|
||
|
||
server:
|
||
image: yyhuni/lunafox-server:${IMAGE_TAG:?IMAGE_TAG is required}
|
||
restart: always
|
||
env_file:
|
||
- .env
|
||
environment:
|
||
- IMAGE_TAG=${IMAGE_TAG}
|
||
- PUBLIC_URL=${PUBLIC_URL:-}
|
||
depends_on:
|
||
redis:
|
||
condition: service_healthy
|
||
volumes:
|
||
- /opt/lunafox:/opt/lunafox
|
||
- /var/run/docker.sock:/var/run/docker.sock
|
||
healthcheck:
|
||
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
|
||
interval: 30s
|
||
timeout: 10s
|
||
retries: 3
|
||
start_period: 60s
|
||
|
||
frontend:
|
||
image: yyhuni/lunafox-frontend:${IMAGE_TAG:?IMAGE_TAG is required}
|
||
restart: always
|
||
depends_on:
|
||
server:
|
||
condition: service_healthy
|
||
healthcheck:
|
||
test: ["CMD", "node", "-e", "require('http').get('http://localhost:3000',res=>process.exit(res.statusCode<500?0:1)).on('error',()=>process.exit(1))"]
|
||
interval: 5s
|
||
timeout: 5s
|
||
retries: 20
|
||
start_period: 20s
|
||
|
||
nginx:
|
||
image: yyhuni/lunafox-nginx:${IMAGE_TAG:?IMAGE_TAG is required}
|
||
restart: always
|
||
depends_on:
|
||
server:
|
||
condition: service_healthy
|
||
frontend:
|
||
condition: service_healthy
|
||
ports:
|
||
- "8083:8083"
|
||
volumes:
|
||
- ./nginx/ssl:/etc/nginx/ssl:ro
|
||
|
||
volumes:
|
||
postgres_data:
|
||
|
||
networks:
|
||
default:
|
||
name: lunafox_network # 固定网络名,不随目录名变化
|