This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
# Lab 2 stack: api -> postgres (source of truth) + valkey (session cache).
|
||||
# Prepare secrets first: scripts/init-secrets.sh. Start: docker compose up -d --build --wait
|
||||
name: messenger-lab2
|
||||
|
||||
x-api: &api
|
||||
@@ -20,7 +18,6 @@ x-api: &api
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
valkey:
|
||||
# The cache is optional for correctness: only wait for the container to start.
|
||||
condition: service_started
|
||||
migrate:
|
||||
condition: service_completed_successfully
|
||||
@@ -47,11 +44,9 @@ services:
|
||||
|
||||
valkey:
|
||||
image: valkey/valkey:8.1.4-alpine3.22
|
||||
# requirepass and cache-only settings live in the secret config file.
|
||||
command: ["valkey-server", "/run/secrets/valkey_conf"]
|
||||
secrets: [valkey_conf]
|
||||
healthcheck:
|
||||
# NOAUTH also proves the server answers; the password stays out of the process list.
|
||||
test: ["CMD-SHELL", "valkey-cli ping 2>&1 | grep -qE 'PONG|NOAUTH'"]
|
||||
interval: 2s
|
||||
timeout: 3s
|
||||
@@ -75,8 +70,6 @@ services:
|
||||
ports:
|
||||
- "127.0.0.1:${APP_PORT:-8080}:8080"
|
||||
|
||||
# Same image with a 2-second TTL, only for the expiry test:
|
||||
# docker compose --profile ttl-test up -d --wait api-short-ttl
|
||||
api-short-ttl:
|
||||
<<: *api
|
||||
profiles: [ttl-test]
|
||||
|
||||
Reference in New Issue
Block a user