This commit is contained in:
@@ -37,6 +37,7 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}
|
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}
|
||||||
REDIS_URL: redis://redis:6379
|
REDIS_URL: redis://redis:6379
|
||||||
|
IMAGE_STORAGE_ROOT: /var/lib/pokemon-inventory/images
|
||||||
depends_on:
|
depends_on:
|
||||||
postgres:
|
postgres:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
@@ -44,6 +45,8 @@ services:
|
|||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
expose:
|
expose:
|
||||||
- "3000"
|
- "3000"
|
||||||
|
volumes:
|
||||||
|
- image-storage:${IMAGE_STORAGE_VOLUME:-/var/lib/pokemon-inventory/images}
|
||||||
healthcheck:
|
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))"]
|
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
|
interval: 10s
|
||||||
@@ -61,11 +64,14 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}
|
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}
|
||||||
REDIS_URL: redis://redis:6379
|
REDIS_URL: redis://redis:6379
|
||||||
|
IMAGE_STORAGE_ROOT: /var/lib/pokemon-inventory/images
|
||||||
depends_on:
|
depends_on:
|
||||||
postgres:
|
postgres:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
redis:
|
redis:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
volumes:
|
||||||
|
- image-storage:${IMAGE_STORAGE_VOLUME:-/var/lib/pokemon-inventory/images}
|
||||||
|
|
||||||
web:
|
web:
|
||||||
image: ${WEB_IMAGE:-pokemon-inventory-web}:${IMAGE_TAG:-latest}
|
image: ${WEB_IMAGE:-pokemon-inventory-web}:${IMAGE_TAG:-latest}
|
||||||
@@ -87,3 +93,4 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
postgres-data:
|
postgres-data:
|
||||||
redis-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`
|
application and serves it through Nginx with SPA fallback and internal `/api`
|
||||||
proxying.
|
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
|
## Tagged Releases And Rollback
|
||||||
|
|
||||||
Use an immutable release tag for every deployment. The production Compose file
|
Use an immutable release tag for every deployment. The production Compose file
|
||||||
|
|||||||
Reference in New Issue
Block a user