背景:此前误将宿主端口冲突当作新建 compose 服务的理由,实际应按技术架构使用本机已有 PostgreSQL/Redis。 改动: - 删除 lingxi-pg / lingxi-redis 容器及数据卷,不再另起数据库; - DATABASE_URL 改回 127.0.0.1:5432/lingxi,REDIS_URL 改回 127.0.0.1:6379; - 在已有 docker-postgres-1 中创建 lingxi 库并执行迁移/seed; - compose 仅保留无法拉取镜像的 S3 兼容服务; - README、A0 报告同步依赖来源。 影响面:仅本地开发依赖与文档;代码/接口/数据模型不变。 回滚方式:git revert 本提交,并按旧 compose 重新初始化(不推荐)。 验证:migrate deploy、db:seed、test:int、pnpm ci:local(85.9s)全部通过。
This commit is contained in:
1 parent
68b5ca20f4
commit
620cb93a46
4 files changed
+19
-55
No files matched your search
@@ -1,49 +1,14 @@
|
||||
# 灵犀 · 本地开发环境编排(PG18 / Redis 7.4 / S3 兼容对象存储)
|
||||
# 灵犀 · 本地开发对象存储(S3 协议兼容)
|
||||
# 用法:pnpm compose:up / pnpm compose:down
|
||||
# 说明:本机已有其他 PG/Redis 占用 5432/6379,这里宿主端口统一改用 15432/16379,
|
||||
# 容器内端口保持标准值;对应 DATABASE_URL / REDIS_URL 见根目录 .env.example。
|
||||
#
|
||||
# 数据库与 Redis 复用本机已有 Docker 服务,不再由本文件创建:
|
||||
# PostgreSQL → docker-postgres-1,127.0.0.1:5432,库 lingxi / 用户 postgres / 密码 postgres
|
||||
# Redis → docker-redis-1,127.0.0.1:6379
|
||||
# 本文件只管理 S3 兼容服务:2026-11 实测 minio/minio 与 minio/mc 镜像在当前网络不可拉取,
|
||||
# 本地改用 Adobe S3Mock 提供 assets/renders/temp/archive 四个桶;接入真实 MinIO 时仅替换本服务。
|
||||
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
|
||||
@@ -65,6 +30,4 @@ services:
|
||||
start_period: 20s
|
||||
|
||||
volumes:
|
||||
lingxi-pg-data:
|
||||
lingxi-redis-data:
|
||||
lingxi-s3-data:
|
||||
Reference in new issue
Block a user