Files
xiaoxia-saas/infra/docker/infra.yml
T
xiaoxia a5f1d9685d
Deploy / Staging E2E Tests (push) Has been skipped
Deploy / Build Production Runtime Images (push) Has been skipped
Deploy / Deploy Production (push) Has been skipped
Deploy / Production Browser E2E (push) Has been skipped
Deploy / Deploy Staging (push) Failing after 141h44m9s
CI/CD Pipeline / Frontend Lint (push) Failing after 141h44m18s
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 141h44m18s
refactor(phase3): Docker 网络隔离 staging/production 环境
- compose.yml: 网络名根据 ENV 变量区分 (xiaoxia-net-staging/xiaoxia-net-production)
- infra-production.yml: 使用 xiaoxia-net-production 网络
- infra.yml: 使用 xiaoxia-net-staging 网络
- 新增 nginx-staging.conf (proxy_pass -> xiaoxia-api-staging:8000)
- 新增 nginx-production.conf (proxy_pass -> xiaoxia-api-production:8000)
- nginx.conf 更新为 production 默认配置
- web-artifact.Dockerfile: 添加 ARG NGINX_CONF 支持构建时选择 nginx 配置
- deploy-staging.sh: 添加 ENV=staging、网络创建、nginx 配置选择
- deploy-production.sh: 添加 ENV=production、网络创建
- deploy.yml: CI 构建传入 NGINX_CONF 参数、远程部署脚本添加网络创建
- deploy.yml: 冒烟测试添加网络隔离验证
2026-07-03 15:09:54 +08:00

58 lines
1.2 KiB
YAML

version: '3.8'
# ===========================================
# 日志轮转配置(所有服务共享)
# ===========================================
x-logging: &default-logging
driver: json-file
options:
max-size: "50m"
max-file: "3"
services:
postgres:
image: postgres:16
container_name: xiaoxia-postgres
restart: always
environment:
POSTGRES_DB: xiaoxia_saas
POSTGRES_USER: xiaoxia
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme_in_production}
ports:
- "127.0.0.1:5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- xiaoxia-net
logging: *default-logging
healthcheck:
test: ["CMD-SHELL", "pg_isready -U xiaoxia"]
interval: 30s
timeout: 5s
retries: 5
redis:
image: redis:7
container_name: xiaoxia-redis
restart: always
ports:
- "127.0.0.1:6379:6379"
volumes:
- redis_data:/data
networks:
- xiaoxia-net
logging: *default-logging
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 30s
timeout: 3s
retries: 5
volumes:
postgres_data:
redis_data:
networks:
xiaoxia-net:
name: xiaoxia-net-staging