forked from mtusi2026/mtusi2026lab2
added a session storage policy in Redis
This commit is contained in:
+29
-1
@@ -16,6 +16,31 @@ services:
|
||||
timeout: 3s
|
||||
retries: 10
|
||||
|
||||
redis:
|
||||
image: redis:7.4.2-bookworm
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
REDIS_PASSWORD: ${REDIS_PASSWORD}
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
- >-
|
||||
exec redis-server
|
||||
--appendonly yes
|
||||
--appendfsync always
|
||||
--maxmemory 256mb
|
||||
--maxmemory-policy noeviction
|
||||
--requirepass "$$REDIS_PASSWORD"
|
||||
volumes:
|
||||
- redisdata:/data
|
||||
ports:
|
||||
- "127.0.0.1:6379:6379"
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "redis-cli -a \"$$REDIS_PASSWORD\" --no-auth-warning ping | grep -q PONG"]
|
||||
interval: 5s
|
||||
timeout: 3s
|
||||
retries: 10
|
||||
|
||||
migrate:
|
||||
build: .
|
||||
image: mtusi-messenger:lab2
|
||||
@@ -36,8 +61,11 @@ services:
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
migrate:
|
||||
condition: service_completed_successfully
|
||||
|
||||
volumes:
|
||||
pgdata:
|
||||
pgdata:
|
||||
redisdata:
|
||||
Reference in New Issue
Block a user