forked from mtusi2026/mtusi2026lab2
35 lines
828 B
YAML
35 lines
828 B
YAML
services:
|
|
api:
|
|
build: .
|
|
ports:
|
|
- "8080:8080"
|
|
environment:
|
|
- DATABASE_URL=postgresql://messenger:messenger_pass@postgres:5432/messenger
|
|
- SESSION_TTL_SECONDS=3600
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:8080/health/ready"]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 5
|
|
restart: unless-stopped
|
|
|
|
postgres:
|
|
image: postgres:16.1
|
|
environment:
|
|
- POSTGRES_DB=messenger
|
|
- POSTGRES_USER=messenger
|
|
- POSTGRES_PASSWORD=messenger_pass
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U messenger"]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 5
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
postgres_data: |