添加 Docker 和 CI/CD 配置(无 SSH 方案)
Some checks failed
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Failing after 0s

This commit is contained in:
2026-01-19 14:56:40 +08:00
parent a6940e78df
commit 589197e284
10 changed files with 1000 additions and 42 deletions

58
docker-compose.prod.yml Normal file
View File

@@ -0,0 +1,58 @@
version: '3.8'
services:
api:
image: registry.boss160.cn/junhong/cmp-fiber-api:latest
container_name: junhong-cmp-api
restart: unless-stopped
ports:
- "8088:8088"
environment:
- CONFIG_ENV=prod
- DB_HOST=${DB_HOST}
- DB_PORT=${DB_PORT}
- DB_USER=${DB_USER}
- DB_PASSWORD=${DB_PASSWORD}
- DB_NAME=${DB_NAME}
- DB_SSLMODE=${DB_SSLMODE}
volumes:
- ./configs:/app/configs:ro
- ./logs:/app/logs
- ./.env:/app/.env:ro
networks:
- junhong-network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8088/health"]
interval: 30s
timeout: 3s
retries: 3
start_period: 10s
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
worker:
image: registry.boss160.cn/junhong/cmp-fiber-worker:latest
container_name: junhong-cmp-worker
restart: unless-stopped
environment:
- CONFIG_ENV=prod
volumes:
- ./configs:/app/configs:ro
- ./logs:/app/logs
networks:
- junhong-network
depends_on:
api:
condition: service_healthy
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
networks:
junhong-network:
driver: bridge