fix: add Redis service and REDIS_URL to web container
This commit is contained in:
@@ -22,6 +22,26 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- memento-network
|
- memento-network
|
||||||
|
|
||||||
|
# ============================================
|
||||||
|
# Redis - Cache & Quota Tracking
|
||||||
|
# ============================================
|
||||||
|
redis:
|
||||||
|
image: redis:7-alpine
|
||||||
|
container_name: memento-redis
|
||||||
|
restart: unless-stopped
|
||||||
|
command: redis-server --maxmemory 128mb --maxmemory-policy allkeys-lru
|
||||||
|
volumes:
|
||||||
|
- redis-data:/data
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:6379:6379"
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "redis-cli", "ping"]
|
||||||
|
interval: 5s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
|
networks:
|
||||||
|
- memento-network
|
||||||
|
|
||||||
# ============================================
|
# ============================================
|
||||||
# memento-note - Next.js Web Application
|
# memento-note - Next.js Web Application
|
||||||
# ============================================
|
# ============================================
|
||||||
@@ -37,8 +57,8 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- "3000:3000"
|
- "3000:3000"
|
||||||
environment:
|
environment:
|
||||||
# DATABASE_URL is auto-constructed from PostgreSQL credentials (not in .env.docker)
|
|
||||||
- DATABASE_URL=postgresql://${POSTGRES_USER:-memento}:${POSTGRES_PASSWORD:-memento}@postgres:5432/${POSTGRES_DB:-memento}
|
- DATABASE_URL=postgresql://${POSTGRES_USER:-memento}:${POSTGRES_PASSWORD:-memento}@postgres:5432/${POSTGRES_DB:-memento}
|
||||||
|
- REDIS_URL=redis://redis:6379
|
||||||
- NODE_ENV=production
|
- NODE_ENV=production
|
||||||
- NEXT_TELEMETRY_DISABLED=1
|
- NEXT_TELEMETRY_DISABLED=1
|
||||||
# ADMIN_EMAIL comes from .env.docker via env_file directive above
|
# ADMIN_EMAIL comes from .env.docker via env_file directive above
|
||||||
@@ -48,6 +68,8 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
postgres:
|
postgres:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
redis:
|
||||||
|
condition: service_healthy
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "node", "-e", "require('http').get('http://localhost:3000/',r=>process.exit(r.statusCode<500?0:1)).on('error',()=>process.exit(1))"]
|
test: ["CMD", "node", "-e", "require('http').get('http://localhost:3000/',r=>process.exit(r.statusCode<500?0:1)).on('error',()=>process.exit(1))"]
|
||||||
@@ -138,6 +160,8 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
postgres-data:
|
postgres-data:
|
||||||
driver: local
|
driver: local
|
||||||
|
redis-data:
|
||||||
|
driver: local
|
||||||
uploads-data:
|
uploads-data:
|
||||||
driver: local
|
driver: local
|
||||||
backup-data:
|
backup-data:
|
||||||
|
|||||||
Reference in New Issue
Block a user