build(db): 初始化本地依赖与 Prisma 基线
提供 PG18/Redis7.4/S3 本地 compose、环境变量样例与 Prisma 首版迁移;建立 outbox_events、idempotency_keys、system_configs 三张平台骨架表及幂等种子。MinIO 镜像不可得,本地以 S3Mock 替代。
This commit is contained in:
1 parent
b3a2a843bb
commit
09dbb27b66
8 files changed
+377
No files matched your search
@@ -0,0 +1,4 @@
|
||||
# 技术架构 §4.1.1 引用的路径为 infra/compose.dev.yaml,这里做 include 兼容。
|
||||
# 实际定义在 infra/docker-compose.dev.yaml(开发计划 §6.1 与工程规范 README 的命名)。
|
||||
include:
|
||||
- docker-compose.dev.yaml
|
||||
@@ -0,0 +1,70 @@
|
||||
# 灵犀 · 本地开发环境编排(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: lingxi
|
||||
POSTGRES_PASSWORD: lingxi_dev_password
|
||||
POSTGRES_DB: lingxi_dev
|
||||
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 lingxi -d lingxi_dev']
|
||||
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:
|
||||
Reference in new issue
Block a user