colaborative tích hợp redis để đồng bộ toàn bộ annotation

This commit is contained in:
2026-04-01 18:29:56 +07:00
parent 9335e56322
commit 8546d41a26
9 changed files with 372 additions and 26 deletions
+16
View File
@@ -18,6 +18,19 @@ services:
networks:
- lms_net
# ── Redis (temp annotation cache) ────────────────────────────────────────────
redis:
image: redis:7-alpine
restart: unless-stopped
command: redis-server --save "" --appendonly no # in-memory only, no disk writes
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
networks:
- lms_net
# ── FastAPI backend ───────────────────────────────────────────────────────────
backend:
image: ${BACKEND_IMAGE:-lms-backend:latest}
@@ -28,12 +41,15 @@ services:
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
environment:
DATABASE_URL: postgresql+psycopg2://${POSTGRES_USER:-lms_user}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB:-lms_db}
JWT_SECRET_KEY: ${JWT_SECRET_KEY}
JWT_ALGORITHM: HS256
ACCESS_TOKEN_EXPIRE_MINUTES: ${ACCESS_TOKEN_EXPIRE_MINUTES:-60}
UPLOAD_DIR: /uploads
REDIS_URL: redis://redis:6379/0
volumes:
- pdf_uploads:/uploads
expose: