Skip to content

chore: 生产 compose 容器化 PG/Redis(服务器直建部署) - #3

Open
guanlili wants to merge 3 commits into
mainfrom
feat/open-api-platform
Open

chore: 生产 compose 容器化 PG/Redis(服务器直建部署)#3
guanlili wants to merge 3 commits into
mainfrom
feat/open-api-platform

Conversation

@guanlili

@guanlili guanlili commented Sep 4, 2026

Copy link
Copy Markdown
Owner

Summary

  • 生产 docker-compose.yml 增加 postgres:16-alpine / redis:7-alpine(host 网络、仅监听 127.0.0.1、数据持久化 ./data)
  • 数据库/Redis 密码改为根目录 .env 插值注入,不进仓库;.gitignore 忽略 /data/
  • backend/celery 增加 PG/Redis 健康依赖

背景

10.2.51.94 生产部署需要整栈容器化;该提交已实际用于服务器端 git clone + compose up --build 部署流程。

Test plan

  • 本地 docker compose config 校验通过
  • 服务器构建启动后 health 全绿

- 生产 docker-compose.yml 增加 postgres:16-alpine / redis:7-alpine(host 网络、仅监听 127.0.0.1、AOF/数据持久化到 ./data)
- 敏感项(数据库/Redis 密码)改为根目录 .env 插值注入,不进仓库
- backend/celery 增加 PG/Redis 健康依赖,启动顺序有保障
- .gitignore 忽略 /data/ 生产数据目录
CentOS7 + elrepo 5.4.6 宿主机上 Docker 默认 seccomp 配置档导致
postgres initdb 写 postmaster.pid/pg_wal 报 EPERM(实测 unconfined 即恢复),
仅对 postgres 服务解除,其余容器保持默认隔离。
默认配置档本身含 pwritev2 白名单;真实根因是 CentOS7 系统 libseccomp 2.3.1
无法解析该系统调用名导致规则被 runc 静默跳过。宿主机升级 libseccomp 2.5.4
(/usr/local/lib + ldconfig)后默认 seccomp 全面恢复,compose 无需特殊处理。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant