This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user