From cb26d16061a2c0b49ba58e804ad17c968359db0b Mon Sep 17 00:00:00 2001 From: FragginWagon Date: Wed, 9 Sep 2026 18:18:24 -0400 Subject: [PATCH] feat: persist production image storage --- compose.production.yaml | 7 +++++++ docs/DEPLOYMENT.md | 10 ++++++++++ 2 files changed, 17 insertions(+) diff --git a/compose.production.yaml b/compose.production.yaml index b89318d..6a7b141 100644 --- a/compose.production.yaml +++ b/compose.production.yaml @@ -37,6 +37,7 @@ services: environment: DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB} REDIS_URL: redis://redis:6379 + IMAGE_STORAGE_ROOT: /var/lib/pokemon-inventory/images depends_on: postgres: condition: service_healthy @@ -44,6 +45,8 @@ services: condition: service_healthy expose: - "3000" + volumes: + - image-storage:${IMAGE_STORAGE_VOLUME:-/var/lib/pokemon-inventory/images} healthcheck: test: ["CMD", "node", "-e", "fetch('http://127.0.0.1:3000/health').then((response) => process.exit(response.ok ? 0 : 1)).catch(() => process.exit(1))"] interval: 10s @@ -61,11 +64,14 @@ services: environment: DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB} REDIS_URL: redis://redis:6379 + IMAGE_STORAGE_ROOT: /var/lib/pokemon-inventory/images depends_on: postgres: condition: service_healthy redis: condition: service_healthy + volumes: + - image-storage:${IMAGE_STORAGE_VOLUME:-/var/lib/pokemon-inventory/images} web: image: ${WEB_IMAGE:-pokemon-inventory-web}:${IMAGE_TAG:-latest} @@ -87,3 +93,4 @@ services: volumes: postgres-data: redis-data: + image-storage: diff --git a/docs/DEPLOYMENT.md b/docs/DEPLOYMENT.md index 5b429a2..ce25ad1 100644 --- a/docs/DEPLOYMENT.md +++ b/docs/DEPLOYMENT.md @@ -45,6 +45,16 @@ worker images share the same Node workspace image; the web image builds the Vue application and serves it through Nginx with SPA fallback and internal `/api` proxying. +API and worker share the persistent `image-storage` volume at +`/var/lib/pokemon-inventory/images`. Set `IMAGE_STORAGE_VOLUME` to a NAS bind +mount when deploying outside Docker-managed volumes, for example: + +```env +IMAGE_STORAGE_VOLUME=/volume1/docker/pokemon-inventory/images +``` + +Include this directory in image-storage backups alongside PostgreSQL dumps. + ## Tagged Releases And Rollback Use an immutable release tag for every deployment. The production Compose file