Реализация Лабораторной 2: PostgreSQL, Valkey, кэширование
Skeleton contracts / contracts (pull_request) Failing after 35s
Skeleton contracts / contracts (pull_request) Failing after 35s
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:16.4-alpine
|
||||
environment:
|
||||
POSTGRES_USER: ${POSTGRES_USER}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||
POSTGRES_DB: ${POSTGRES_DB}
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
restart: unless-stopped
|
||||
|
||||
redis:
|
||||
image: valkey/valkey:8.0-alpine # Используем Valkey как современный форк Redis
|
||||
command: valkey-server --appendonly yes --save 60 1
|
||||
volumes:
|
||||
- redis_data:/data
|
||||
healthcheck:
|
||||
test: ["CMD", "valkey-cli", "ping"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
restart: unless-stopped
|
||||
|
||||
api:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
environment:
|
||||
- DATABASE_URL=${DATABASE_URL}
|
||||
- REDIS_URL=${REDIS_URL}
|
||||
- SECRET_SESSION_KEY=${SECRET_SESSION_KEY}
|
||||
- SESSION_TTL_SECONDS=${SESSION_TTL_SECONDS}
|
||||
ports:
|
||||
- "8080:8080"
|
||||
volumes:
|
||||
- ./alembic/versions:/app/alembic/versions # <-- ДОБАВИТЬ ЭТУ СТРОКУ
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
redis_data:
|
||||
Reference in New Issue
Block a user