Files
lingxi/infra/docker-compose.dev.yaml
T
Stev_Wang 68b5ca20f4
ci / 质量门禁 (push) Canceled after 0s
ci(ci): 支持本地 CI 并调整开发库凭据
背景:Gitea 暂未部署 Actions runner,远程 CI 会停留在 queued;本地开发库按约定改用 lingxi / postgres / postgres。

改动:
- 新增 pnpm ci:local,按 CI 工作流顺序执行 compose、格式、Lint、类型、单测、构建、迁移种子、集成、OpenAPI 与 e2e;
- 新增 scripts/e2e.mjs 管理 vite preview 生命周期,e2e 改为单 worker 避免退出挂起;
- openapi:export 生成后自动 Prettier,保持工作区干净;
- compose、.env.example、CI services 数据库凭据统一为 postgres/postgres,库名 lingxi;
- README、AGENTS、A0 报告同步本地 CI 与数据库说明。

影响面:仅本地开发与 CI 执行方式,无业务代码/接口/数据模型变更;本地库已重建为 lingxi/postgres。
回滚方式:git revert 本提交;数据库需按回滚后的 compose 凭据重新初始化。
验证:pnpm ci:local 全绿(158s),format:check、lint、typecheck、openapi:diff 通过。
2026-11-02 18:14:08 +08:00

71 lines
2.3 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.
# 灵犀 · 本地开发环境编排(PG18 / Redis 7.4 / S3 兼容对象存储)
# 用法:pnpm compose:up / pnpm compose:down
# 说明:本机已有其他 PG/Redis 占用 5432/6379,这里宿主端口统一改用 15432/16379,
# 容器内端口保持标准值;对应 DATABASE_URL / REDIS_URL 见根目录 .env.example。
name: lingxi-dev
services:
postgres:
image: postgres:18-alpine
container_name: lingxi-pg
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: lingxi
TZ: Asia/Shanghai
ports:
- '15432:5432'
volumes:
# PG18+ 镜像要求挂载 /var/lib/postgresql(数据放在版本子目录,便于 pg_upgrade)
- lingxi-pg-data:/var/lib/postgresql
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U postgres -d lingxi']
interval: 5s
timeout: 3s
retries: 20
start_period: 10s
redis:
image: redis:7.4-alpine
container_name: lingxi-redis
command: ['redis-server', '--appendonly', 'yes']
ports:
- '16379:6379'
volumes:
- lingxi-redis-data:/data
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
interval: 5s
timeout: 3s
retries: 20
start_period: 5s
# 对象存储:技术架构要求 MinIO(S3 协议)。2026-11 实测 minio/minio 与 minio/mc
# 官方镜像在当前网络/仓库均无法拉取(registry denied),quay.io 需鉴权;
# 本地开发改用 S3 兼容的 Adobe S3Mock,接口与四桶(assets/renders/temp/archive)保持一致,
# S3_ENDPOINT 仍指向 19000。CI/生产接入真实 MinIO,切换时仅替换本服务。
s3:
image: adobe/s3mock:latest
container_name: lingxi-s3
environment:
COM_ADOBE_TESTING_S3MOCK_STORE_INITIAL_BUCKETS: assets,renders,temp,archive
COM_ADOBE_TESTING_S3MOCK_STORE_REGION: us-east-1
COM_ADOBE_TESTING_S3MOCK_STORE_ROOT: /s3mockroot
COM_ADOBE_TESTING_S3MOCK_STORE_RETAIN_FILES_ON_EXIT: 'true'
ports:
- '19000:9090'
- '19001:9191'
volumes:
- lingxi-s3-data:/s3mockroot
healthcheck:
test: ['CMD-SHELL', 'wget -q -O /dev/null http://127.0.0.1:9090/ || exit 1']
interval: 5s
timeout: 3s
retries: 20
start_period: 20s
volumes:
lingxi-pg-data:
lingxi-redis-data:
lingxi-s3-data: