Use bind mount for prod database storage instead of named volume

Store PostgreSQL data at ./data/postgres relative to the compose file
so persistent data lives on the Unraid disk at
/mnt/user/appdata/nuzlocke-tracker/data/postgres.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Julian Tabel
2026-02-10 09:17:14 +01:00
parent 61a7f57f1f
commit 3f39b5f0cb
3 changed files with 15 additions and 5 deletions

View File

@@ -5,7 +5,7 @@ status: in-progress
type: epic
priority: normal
created_at: 2026-02-09T14:03:53Z
updated_at: 2026-02-09T16:53:58Z
updated_at: 2026-02-10T08:16:36Z
---
Define and implement a deployment strategy for running the nuzlocke-tracker in production on a local Unraid server while keeping laptop/PC as the development environment.
@@ -28,7 +28,7 @@ Define and implement a deployment strategy for running the nuzlocke-tracker in p
4. **Portainer** is installed on Unraid to manage stacks, provide a web UI, and enable webhook-triggered redeployments.
5. **A deploy script** on the dev machine automates the full flow: build images → push to Gitea registry → trigger Portainer webhook to redeploy.
6. **Nginx Proxy Manager** handles routing on the LAN (e.g., `nuzlocke.nerdboden.de` → frontend container, `gitea.nerdboden.de` → Gitea).
7. **Database** uses a named Docker volume for persistence; migrations run automatically on API container startup.
7. **Database** uses a bind mount (`./data/postgres`) for persistence on the Unraid disk; migrations run automatically on API container startup. The compose file lives at `/mnt/user/appdata/nuzlocke-tracker/`, so all persistent data is stored in subfolders there.
## Branching Strategy

View File

@@ -0,0 +1,12 @@
---
# nuzlocke-tracker-jzw4
title: Switch prod compose to bind mounts for persistent data
status: completed
type: task
priority: normal
created_at: 2026-02-10T08:15:41Z
updated_at: 2026-02-10T08:16:44Z
parent: nuzlocke-tracker-ahza
---
Replace named Docker volume with bind mount to ./data/postgres subfolder. The docker-compose.prod.yml will live at /mnt/user/appdata/nuzlocke-tracker/ on Unraid, so relative paths resolve to subfolders there.

View File

@@ -26,7 +26,7 @@ services:
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=nuzlocke
volumes:
- prod_postgres_data:/var/lib/postgresql/data
- ./data/postgres:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
@@ -34,5 +34,3 @@ services:
retries: 5
restart: unless-stopped
volumes:
prod_postgres_data: