docker-compose.yml: add PALIAD_EXPORT_DIR env declaration + volume mount for Backup Mode #105

Closed
opened 2026-05-25 13:53:03 +00:00 by mAi · 1 comment
Collaborator

Context

cronus's #77 Slice A Backup Mode (commit 99c9d89 / merged at 51fca93) introduced the PALIAD_EXPORT_DIR env var. Unset → /admin/backups returns 503. paliad's docker-compose.yml needs the env declaration (Dokploy interpolates from its secret store) + a volume mount so backups persist across container restarts.

What to do

  1. Edit docker-compose.yml (root of m/paliad):
    • Under services.web.environment: add PALIAD_EXPORT_DIR: ${PALIAD_EXPORT_DIR:-/var/lib/paliad/exports} so the container inherits the var when Dokploy provides it AND falls back to a sensible default. (Per project CLAUDE.md trap: env vars must be declared in compose, not just in Dokploy's env block.)
    • Under services.web.volumes: add a named volume mount: - paliad_exports:/var/lib/paliad/exports
    • At bottom under volumes: declare paliad_exports: (default driver, persistent).
  2. Verify the compose file passes docker compose config locally if possible (or visually scan for indentation correctness).
  3. Push to main → Dokploy auto-redeploys with the new volume + env. After deploy, m needs to set PALIAD_EXPORT_DIR=/var/lib/paliad/exports in Dokploy's env panel for the service to ensure the var is non-empty (or rely on the compose default ${PALIAD_EXPORT_DIR:-/var/lib/paliad/exports}).
  4. After deploy: verify /admin/backups no longer returns 503 + the 'Backup jetzt erstellen' button writes to the volume.

Hard rules

  • Don't change OTHER env vars or volumes; surgical add only.
  • The default fallback in the ${PALIAD_EXPORT_DIR:-/var/lib/paliad/exports} interpolation is intentional — Dokploy may not have the env set at deploy time; the compose default keeps it working.
  • go build ./... && go test ./internal/... && cd frontend && bun run build clean (no code change, but verify the smoke test still passes).
  • Branch: mai/<worker>/dokploy-export-dir-env.

Out of scope

  • Adding other backup-related env vars (none needed for Slice A).
  • Switching to Supabase Storage backend (m chose local disk per #77 Q1).
  • Mounting any other volume.

Reporting

mai report completed with branch + SHAs + verification: paliad.de redeployed, curl -I https://paliad.de/admin/backups (via authenticated admin session) does NOT return 503, and a test backup write succeeds against /var/lib/paliad/exports.

## Context cronus's #77 Slice A Backup Mode (commit `99c9d89` / merged at `51fca93`) introduced the `PALIAD_EXPORT_DIR` env var. Unset → `/admin/backups` returns 503. paliad's docker-compose.yml needs the env declaration (Dokploy interpolates from its secret store) + a volume mount so backups persist across container restarts. ## What to do 1. Edit `docker-compose.yml` (root of `m/paliad`): - Under `services.web.environment:` add `PALIAD_EXPORT_DIR: ${PALIAD_EXPORT_DIR:-/var/lib/paliad/exports}` so the container inherits the var when Dokploy provides it AND falls back to a sensible default. (Per project CLAUDE.md trap: env vars must be declared in compose, not just in Dokploy's env block.) - Under `services.web.volumes:` add a named volume mount: `- paliad_exports:/var/lib/paliad/exports` - At bottom under `volumes:` declare `paliad_exports:` (default driver, persistent). 2. Verify the compose file passes `docker compose config` locally if possible (or visually scan for indentation correctness). 3. Push to main → Dokploy auto-redeploys with the new volume + env. After deploy, m needs to set `PALIAD_EXPORT_DIR=/var/lib/paliad/exports` in Dokploy's env panel for the service to ensure the var is non-empty (or rely on the compose default `${PALIAD_EXPORT_DIR:-/var/lib/paliad/exports}`). 4. After deploy: verify `/admin/backups` no longer returns 503 + the 'Backup jetzt erstellen' button writes to the volume. ## Hard rules - Don't change OTHER env vars or volumes; surgical add only. - The default fallback in the `${PALIAD_EXPORT_DIR:-/var/lib/paliad/exports}` interpolation is intentional — Dokploy may not have the env set at deploy time; the compose default keeps it working. - `go build ./... && go test ./internal/... && cd frontend && bun run build` clean (no code change, but verify the smoke test still passes). - Branch: `mai/<worker>/dokploy-export-dir-env`. ## Out of scope - Adding other backup-related env vars (none needed for Slice A). - Switching to Supabase Storage backend (m chose local disk per #77 Q1). - Mounting any other volume. ## Reporting `mai report completed` with branch + SHAs + verification: paliad.de redeployed, `curl -I https://paliad.de/admin/backups` (via authenticated admin session) does NOT return 503, and a test backup write succeeds against /var/lib/paliad/exports.
mAi self-assigned this 2026-05-25 13:53:03 +00:00
Author
Collaborator

Done — compose patched on mai/artemis/coder-docker-compose-yml.

What changed

Surgical edit to docker-compose.yml (root of m/paliad):

@@ services.web.environment ...
+      # Backup Mode (m/paliad#77 Slice A). Local-disk export target; the
+      # paliad_exports named volume below persists it across container
+      # restarts. Unset → /admin/backups returns 503 (BackupService gate).
+      - PALIAD_EXPORT_DIR=${PALIAD_EXPORT_DIR:-/var/lib/paliad/exports}
+    volumes:
+      - paliad_exports:/var/lib/paliad/exports
     restart: unless-stopped
+
+volumes:
+  paliad_exports:

Note on style: the existing env block uses list-style - KEY=${VALUE} (not map-style KEY: ${VALUE} as the issue body sketched). Kept the list form to match the rest of the file — the resolved value is identical (docker compose config confirms PALIAD_EXPORT_DIR: /var/lib/paliad/exports).

Verification

  • docker compose config resolves cleanly. Env: PALIAD_EXPORT_DIR: /var/lib/paliad/exports. Volume mount + top-level paliad_exports: named volume both parse.
  • go build ./... — clean.
  • go test ./internal/... — clean (all packages pass / cached).
  • cd frontend && bun run build — clean (2862 i18n keys unchanged).

Commit

3700d68c68

Next step (m's hands)

This branch lives on its own and won't auto-deploy until merged to main. Once main picks up the change, Dokploy redeploys with the new volume + env. After redeploy:

  1. Optionally set PALIAD_EXPORT_DIR=/var/lib/paliad/exports explicitly in Dokploy's env panel (the compose default already covers it, but explicit is nicer for the Dokploy UI).
  2. curl -I https://paliad.de/admin/backups via authenticated admin session — should no longer return 503.
  3. Trigger 'Backup jetzt erstellen' and confirm a file lands under /var/lib/paliad/exports inside the container (docker exec <web> ls /var/lib/paliad/exports).

I can't run those final smoke tests from the worktree — they need the production deploy + an admin-cookie'd request. Setting needs-review rather than done until paliad.de is redeployed and the admin-side checks pass.

Done — compose patched on `mai/artemis/coder-docker-compose-yml`. ## What changed Surgical edit to `docker-compose.yml` (root of `m/paliad`): ```diff @@ services.web.environment ... + # Backup Mode (m/paliad#77 Slice A). Local-disk export target; the + # paliad_exports named volume below persists it across container + # restarts. Unset → /admin/backups returns 503 (BackupService gate). + - PALIAD_EXPORT_DIR=${PALIAD_EXPORT_DIR:-/var/lib/paliad/exports} + volumes: + - paliad_exports:/var/lib/paliad/exports restart: unless-stopped + +volumes: + paliad_exports: ``` Note on style: the existing env block uses list-style `- KEY=${VALUE}` (not map-style `KEY: ${VALUE}` as the issue body sketched). Kept the list form to match the rest of the file — the resolved value is identical (`docker compose config` confirms `PALIAD_EXPORT_DIR: /var/lib/paliad/exports`). ## Verification - `docker compose config` resolves cleanly. Env: `PALIAD_EXPORT_DIR: /var/lib/paliad/exports`. Volume mount + top-level `paliad_exports:` named volume both parse. - `go build ./...` — clean. - `go test ./internal/...` — clean (all packages pass / cached). - `cd frontend && bun run build` — clean (2862 i18n keys unchanged). ## Commit https://mgit.msbls.de/m/paliad/commit/3700d68c682d44080182c8ab1ec1f9b394fcd821 ## Next step (m's hands) This branch lives on its own and won't auto-deploy until merged to `main`. Once `main` picks up the change, Dokploy redeploys with the new volume + env. After redeploy: 1. Optionally set `PALIAD_EXPORT_DIR=/var/lib/paliad/exports` explicitly in Dokploy's env panel (the compose default already covers it, but explicit is nicer for the Dokploy UI). 2. `curl -I https://paliad.de/admin/backups` via authenticated admin session — should no longer return 503. 3. Trigger 'Backup jetzt erstellen' and confirm a file lands under `/var/lib/paliad/exports` inside the container (`docker exec <web> ls /var/lib/paliad/exports`). I can't run those final smoke tests from the worktree — they need the production deploy + an admin-cookie'd request. Setting `needs-review` rather than `done` until paliad.de is redeployed and the admin-side checks pass.
m closed this issue 2026-05-25 13:56:14 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: m/paliad#105
No description provided.