添加 Docker 和 CI/CD 配置(无 SSH 方案)
Some checks failed
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Failing after 0s
Some checks failed
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Failing after 0s
This commit is contained in:
58
docker-compose.prod.yml
Normal file
58
docker-compose.prod.yml
Normal 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
|
||||
Reference in New Issue
Block a user