Files
danyang-match/infrastructure/docker-compose.staging.yml
T
WorkBuddy 7186a6b694 fix(infra): minio 镜像钉回确定版本(依据 CI 实测输出)
上一轮为让 CI 先跑通,minio 临时改用 quay.io 的 latest 滚动 tag,并在 e2e job 里
加了一步打印实际版本。该步骤的实测输出为:

  minio version RELEASE.2025-09-07T16-13-09Z (commit-id=07c3a429bfed…)

即 latest 当前正指向这个版本 —— 与本仓库原先在 Docker Hub 上钉的 tag 完全一致。
据此把三处 compose(本地 / staging / prod)统一钉死为
quay.io/minio/minio:RELEASE.2025-09-07T16-13-09Z,恢复「可复现」这一原则:
日后即使 quay 上的 latest 滚动到别的版本,本配置也不受影响。

保留 e2e 中「校验钉版镜像可拉取并打印版本」这一步 —— 镜像拉取失败在 compose up
里会埋进几十行输出,独立一步能在起栈前秒级暴露「上游镜像下架」这类外部依赖失效。

上一轮结果:7 个 job 全部 success,GitHub Actions 首次跑绿。
2026-09-22 11:16:37 +08:00

107 lines
3.6 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.
# Staging Docker Compose(预发环境,仅开发/测试)
version: '3.8'
services:
postgres:
image: postgres:16-alpine
environment:
POSTGRES_DB: danyang_match_staging
POSTGRES_USER: staging
POSTGRES_PASSWORD: staging_dev_password_change_me
ports:
- "5433:5432"
volumes:
- postgres_staging_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U staging -d danyang_match_staging"]
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
ports:
- "6380:6379"
command: redis-server --appendonly yes --requirepass staging-redis-pass-change-me
volumes:
- redis_staging_data:/data
healthcheck:
test: ["CMD", "redis-cli", "-a", "staging-redis-pass-change-me", "ping"]
interval: 10s
timeout: 5s
retries: 5
minio:
# 同 docker-compose.yml 的 minio 条目:Docker Hub 上 minio/minio 仓库已被整体移除
# (MinIO 自 2025-10 起停止发布容器镜像,仅源码分发),staging 环境同样拉不到。
# 改为仍在提供镜像的 quay.io,并钉死为与本地/CI 一致的 RELEASE.2025-09-07T16-13-09Z。
image: quay.io/minio/minio:RELEASE.2025-09-07T16-13-09Z
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: staging
MINIO_ROOT_PASSWORD: staging_dev_password
ports:
- "9010:9000"
- "9011:9001"
volumes:
- minio_staging_data:/data
backend:
build:
context: ../backend
dockerfile: Dockerfile
container_name: danyang-match-staging-backend
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
environment:
SPRING_PROFILES_ACTIVE: staging
DB_HOST: postgres
DB_PORT: 5432
DB_NAME: danyang_match_staging
DB_USER: staging
DB_PASSWORD: staging_dev_password_change_me
REDIS_HOST: redis
REDIS_PORT: 6379
REDIS_PASSWORD: staging-redis-pass-change-me
MINIO_ENDPOINT: http://minio:9000
MINIO_ACCESS_KEY: staging
MINIO_SECRET_KEY: staging_dev_password
JWT_ACCESS_SECRET: staging-access-secret-dev-only
JWT_REFRESH_SECRET: staging-refresh-secret-dev-only
CHECKIN_TOKEN_SECRET: staging-checkin-secret-dev-only
ENCRYPTION_KEY: 32539f3d2fa8123dcec899cc3dbee7347034123a126ac22fcb4702e10c454d50
FEATURES_APPEAL_ENABLED: "true"
ports:
- "8081:8080"
healthcheck:
# 探针用 127.0.0.1 而非 localhost:busybox wget 解析 localhost 时可能优先取 ::1,
# 而服务若只绑 IPv4 会导致探针假失败(本地栈的 nginx 已实测踩到)。
test: ["CMD-SHELL", "curl -f http://127.0.0.1:8080/api/v1/health/ready || exit 1"]
interval: 30s
timeout: 10s
retries: 3
admin-web:
build:
context: ../admin-web
dockerfile: Dockerfile
container_name: danyang-match-staging-admin
depends_on:
- backend
ports:
# staging 与生产同机共存,全部端口按「生产 + 1」错开(5433/6380/8081/13521)。
# 生产管理端为 13520(admin-web/vite.config.ts + docker-compose.prod.yml),
# 故此处为 13521 —— 与 tests/uat/run-uat.sh 的 UAT_ADMIN_URL 默认值一致,
# 两处均由 ui-tests/ui-document-baseline-contracts.mjs 钉住。
# 管理端构建产物部署在 /admin/ 子路径下(见 admin-web/vite.config.ts 的 base),
# 故直连访问地址为 http://localhost:13521/admin/ 。
- "13521:80"
volumes:
postgres_staging_data:
redis_staging_data:
minio_staging_data: