docker-compose.yml has no restart policy, so a host reboot leaves self-hosted installs down

未关闭 适合新手
#9,013 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
1/5
预计耗时
1 小时以内
新手友好度
83/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
docker, docker-compose, postgresql

调研方向

打开仓库根目录下的 docker-compose.yml,找到 postgres、flagsmith 和 flagsmith-task-processor 的服务定义;它们都没有 restart: 键。给这三个服务分别添加 restart: unless-stopped,然后运行 docker compose config,确认文件仍能解析,并且该策略在三个服务上都出现。完成意味着执行 docker compose up -d 后再重启 Docker/主机,三个容器都能在无需手动干预的情况下恢复。同一份报告中的镜像标签固定和 Postgres 版本提升是彼此独立的问题,应拆分为各自的 issue,而不是并入本次更改。

由索引模型根据 Issue 内容生成。

描述

Following the self-hosting steps in the README on a clean Ubuntu 26.04 box (4 cores, 3.8 GB memory, Docker 29.7.2), the stack came up on the first try in about 8 minutes, nearly all of it download. Dashboard, /health and the task processor all returned 200.

Then I stopped and started the machine.

Postgres, flagsmith and flagsmith-task-processor all stayed down until I ran docker compose up -d by hand. None of the three services in docker-compose.yml sets a restart: policy, so Docker does not bring them back.

On a self-hosted customer's server this matters more than it does locally. A routine reboot for a kernel security update takes Flagsmith down, and it stays down until somebody notices and logs in. The flags keep serving from SDK cache for a while, which makes it quieter and therefore worse.

Suggested fix: restart: unless-stopped on postgres, flagsmith and flagsmith-task-processor.

Two smaller things I hit in the same install, happy to split them out if you would rather have separate issues:

  1. The images are tagged latest (docker.flagsmith.com/flagsmith/flagsmith:latest). The one I pulled had been built 13 hours earlier. Two customers who install a week apart end up on different versions, with no version to roll back to or to quote in a support ticket. Pinning a release tag in the compose file, plus a line on how to upgrade, would fix that.

  2. postgres:15.5-alpine is pinned to a November 2023 release. Later 15.x minors carry security fixes.

Happy to open a PR for the restart policy if that is useful.

主要语言
Python
星标
7.4k
派生
613
平均合并
1 天 11 小时
30 天内合并 PR
144

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Flagsmith/flagsmith 的其他 Issue

查看 Flagsmith/flagsmith 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。