Skip to content

fix(docker): exit container when a process crashes; pass all env vars through compose#75

Merged
louisbels merged 1 commit into
mainfrom
claude/self-hosted-install-verify-DbYqV
Jun 1, 2026
Merged

fix(docker): exit container when a process crashes; pass all env vars through compose#75
louisbels merged 1 commit into
mainfrom
claude/self-hosted-install-verify-DbYqV

Conversation

@louisbels
Copy link
Copy Markdown
Member

Self-hosted install verification revealed two issues and doc gaps:

  • entrypoint.sh relied on wait -n pid1 pid2, but busybox ash waits for
    ALL listed pids (-n is not honoured). If the API crashed (e.g. missing
    SERVER_ENCRYPTION_KEY) the container stayed "running" but broken instead
    of exiting so Docker's restart policy could surface the failure. Replaced
    with a kill -0 polling loop that exits as soon as either process dies.

  • docker-compose.yml only whitelisted part of the documented env vars.
    Branding (APP_DESCRIPTION, APP_PRIMARY_COLOR, APP_LOGO_URL, ...),
    API_KEY/API_KEY_N, CAP_*, TRUSTED_PROXIES, MAX_TEXT_SIZE,
    CLEANUP_INTERVAL_MS and DEBUG set in .env were silently ignored.
    All documented variables are now passed through (empty values are
    filtered by the API, so the defaults stay safe).

Docs:

  • README: one-click deploy table (Render button, Coolify, Portainer,
    Synology), clearer PORT semantics, troubleshooting link.
  • docs/self-hosting.md: new Troubleshooting section (restart loop, .env
    changes needing --force-recreate, port conflicts, bind-mount
    permissions, unhealthy container, proxy upload limits), Deploy-to-Render
    button, note that Render disks require a paid plan.

Verified against ghcr.io/largerio/secret:latest with Docker: quick start,
docker run one-liner, Portainer-style stack deploy (no .env file),
note create/read, persistence across restarts, graceful shutdown, and
crash-exit behaviour with the patched entrypoint.

https://claude.ai/code/session_01NrzYX4SD2wdrJetorUU48S

… through compose

Self-hosted install verification revealed two issues and doc gaps:

- entrypoint.sh relied on `wait -n pid1 pid2`, but busybox ash waits for
  ALL listed pids (-n is not honoured). If the API crashed (e.g. missing
  SERVER_ENCRYPTION_KEY) the container stayed "running" but broken instead
  of exiting so Docker's restart policy could surface the failure. Replaced
  with a kill -0 polling loop that exits as soon as either process dies.

- docker-compose.yml only whitelisted part of the documented env vars.
  Branding (APP_DESCRIPTION, APP_PRIMARY_COLOR, APP_LOGO_URL, ...),
  API_KEY/API_KEY_N, CAP_*, TRUSTED_PROXIES, MAX_TEXT_SIZE,
  CLEANUP_INTERVAL_MS and DEBUG set in .env were silently ignored.
  All documented variables are now passed through (empty values are
  filtered by the API, so the defaults stay safe).

Docs:
- README: one-click deploy table (Render button, Coolify, Portainer,
  Synology), clearer PORT semantics, troubleshooting link.
- docs/self-hosting.md: new Troubleshooting section (restart loop, .env
  changes needing --force-recreate, port conflicts, bind-mount
  permissions, unhealthy container, proxy upload limits), Deploy-to-Render
  button, note that Render disks require a paid plan.

Verified against ghcr.io/largerio/secret:latest with Docker: quick start,
docker run one-liner, Portainer-style stack deploy (no .env file),
note create/read, persistence across restarts, graceful shutdown, and
crash-exit behaviour with the patched entrypoint.

https://claude.ai/code/session_01NrzYX4SD2wdrJetorUU48S
@louisbels louisbels merged commit 57c3c55 into main Jun 1, 2026
10 checks passed
@louisbels louisbels deleted the claude/self-hosted-install-verify-DbYqV branch June 1, 2026 19:45
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.

2 participants