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

Aperta Adatta ai principianti
#9,013 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
1/5
Tempo stimato
Meno di un'ora
Idoneità per principianti
83/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
docker, docker-compose, postgresql

Direzione di ricerca

Apri docker-compose.yml nella radice del repository e trova le definizioni dei servizi postgres, flagsmith e flagsmith-task-processor; nessuna di esse riporta una chiave restart:. Aggiungi restart: unless-stopped a ciascuno dei tre servizi, poi esegui docker compose config per confermare che il file venga ancora analizzato e che la politica compaia su tutti e tre. Fatto significa che un docker compose up -d seguito da un riavvio di Docker/host riporta tutti e tre i container senza intervento manuale. Il pinning dei tag delle immagini e il bump di Postgres nello stesso report sono questioni separate e dovrebbero essere divisi in issue proprie invece di essere incorporati in questa modifica.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Python
Stelle
7.4k
Fork
613
Merge medio
1g 11h
PR unite (30g)
144

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Flagsmith/flagsmith

Tutte le issue di Flagsmith/flagsmith

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.