lab2: grade 4 — Redis session cache, race/rollback/expiry tests, EXPLAIN evidence
Skeleton contracts / contracts (pull_request) Canceled after 0s
Skeleton contracts / contracts (pull_request) Canceled after 0s
This commit is contained in:
+22
-1
@@ -17,6 +17,21 @@ services:
|
||||
start_period: 5s
|
||||
restart: unless-stopped
|
||||
|
||||
cache:
|
||||
image: valkey/valkey:8.0.1-alpine
|
||||
command: ["valkey-server", "--save", "", "--appendonly", "no"]
|
||||
volumes:
|
||||
- cache_data:/data
|
||||
ports:
|
||||
- "127.0.0.1:6380:6379"
|
||||
healthcheck:
|
||||
test: ["CMD", "valkey-cli", "ping"]
|
||||
interval: 5s
|
||||
timeout: 3s
|
||||
retries: 10
|
||||
start_period: 3s
|
||||
restart: unless-stopped
|
||||
|
||||
api:
|
||||
build:
|
||||
context: .
|
||||
@@ -24,14 +39,18 @@ services:
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
cache:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
APP_HOST: ${APP_HOST:-0.0.0.0}
|
||||
APP_PORT: ${APP_PORT:-8080}
|
||||
APP_ENV: ${APP_ENV:-lab}
|
||||
SESSION_TTL_SECONDS: ${SESSION_TTL_SECONDS:-3600}
|
||||
DATABASE_URL: postgresql://${POSTGRES_USER:-messenger}:${POSTGRES_PASSWORD:-changeme}@postgres:5432/${POSTGRES_DB:-messenger}
|
||||
CACHE_URL: redis://cache:6379/0
|
||||
ports:
|
||||
- "127.0.0.1:8080:8080"
|
||||
|
||||
healthcheck:
|
||||
test: ["CMD", "python", "-c", "import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://127.0.0.1:8080/health/live', timeout=2).status==200 else 1)"]
|
||||
interval: 10s
|
||||
@@ -42,4 +61,6 @@ services:
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
name: mtusi_lab2_postgres_data
|
||||
name: mtusi_lab2_postgres_data
|
||||
cache_data:
|
||||
name: mtusi_lab2_cache_data
|
||||
Reference in New Issue
Block a user