54 lines
1.2 KiB
YAML
54 lines
1.2 KiB
YAML
services:
|
|
api:
|
|
build: .
|
|
ports:
|
|
- "127.0.0.1:8080:8080"
|
|
environment:
|
|
- PORT=8080
|
|
- DATABASE_URL=postgres://lab2:lab2@postgres:5432/lab2?sslmode=disable&timezone=UTC
|
|
- REDIS_URL=redis://redis:6379/0
|
|
- SESSION_TTL_SECONDS=86400
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
restart: unless-stopped
|
|
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
environment:
|
|
POSTGRES_USER: lab2
|
|
POSTGRES_PASSWORD: lab2
|
|
POSTGRES_DB: lab2
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
ports:
|
|
- "127.0.0.1:5432:5432"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U lab2"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
redis:
|
|
image: redis:7-alpine
|
|
command: >
|
|
redis-server
|
|
--appendonly yes
|
|
--appendfsync everysec
|
|
--auto-aof-rewrite-percentage 100
|
|
--auto-aof-rewrite-min-size 64mb
|
|
volumes:
|
|
- redis_data:/data
|
|
ports:
|
|
- "127.0.0.1:6379:6379"
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 5
|
|
|
|
volumes:
|
|
postgres_data:
|
|
redis_data: |