Skip to content

fix(devops): add restart policy to backend & frontend containers#2933

Merged
lifeart merged 1 commit into
masterfrom
fix/compose-restart-policy
Jul 13, 2026
Merged

fix(devops): add restart policy to backend & frontend containers#2933
lifeart merged 1 commit into
masterfrom
fix/compose-restart-policy

Conversation

@lifeart

@lifeart lifeart commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Problem

https://www.brainup.site/ went down: ports 80/443 returned connection refused. Diagnosis showed the VPS itself was healthy (SSH open, the self-hosted selectel Actions runner online), but the brn_fe_with_tls (nginx/TLS) container had stopped and never came back.

Root cause: in docker-compose-run.yml, the brn (backend) and brn_fe_with_tls (frontend/nginx) services have no restart: policy, while db_brn has restart: always. So after a reboot/OOM the database recovers but the web + backend containers stay down.

Recovery for the current outage was done by dispatching the Update TLS certificates for selectel workflow (its last step runs docker compose restart brn_fe_with_tls). This PR prevents recurrence.

Change

Add restart: unless-stopped to brn and brn_fe_with_tls so they self-recover on crash/reboot, matching the DB's existing resilience.

  brn:
    ...
    restart: unless-stopped
  brn_fe_with_tls:
    ...
    restart: unless-stopped

certbot is intentionally left without a policy (one-shot job). unless-stopped is used rather than always so a deliberate manual docker stop is respected across daemon restarts.

Notes

  • Only touches the production compose file used by the redeploy pipeline (docker-compose-run.yml). The change ships automatically on merge to master.
  • No app/code changes; infra-only.

🤖 Generated with Claude Code

The `brn` (backend) and `brn_fe_with_tls` (nginx/TLS) services in the
production compose file had no `restart:` policy, so after a VPS reboot
or OOM they stayed down while `db_brn` (restart: always) came back. This
took https://www.brainup.site/ offline: ports 80/443 returned connection
refused because no web container was listening.

Add `restart: unless-stopped` to both services so they self-recover on
crash/reboot, matching the resilience already configured for the DB.
`certbot` is intentionally left without a policy since it is a one-shot job.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@lifeart
lifeart requested a review from ElenaSpb as a code owner July 13, 2026 12:01
@github-actions

Copy link
Copy Markdown

Frontend test coverage: 72.7% (-0.04% compared to 72.74% on base)

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

Gradle Unit and Integration Test Results

523 tests  ±0   521 ✔️ ±0   36s ⏱️ -4s
116 suites ±0       2 💤 ±0 
116 files   ±0       0 ±0 

Results for commit d24b2c2. ± Comparison against base commit 72f1a2c.

@lifeart
lifeart merged commit 12f9226 into master Jul 13, 2026
9 checks passed
@lifeart
lifeart deleted the fix/compose-restart-policy branch July 13, 2026 12:24
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