chore: 生产 compose 容器化 PG/Redis(服务器直建部署) - #3
Open
guanlili wants to merge 3 commits into
Open
Conversation
- 生产 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 无需特殊处理。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
背景
10.2.51.94 生产部署需要整栈容器化;该提交已实际用于服务器端 git clone + compose up --build 部署流程。
Test plan
docker compose config校验通过