forked from mtusi2026/mtusi2026lab2
36 lines
879 B
YAML
36 lines
879 B
YAML
services:
|
|
postgres:
|
|
image: postgres:16.4-alpine
|
|
environment:
|
|
POSTGRES_DB: messenger
|
|
POSTGRES_USER: messenger
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U messenger -d messenger"]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 20
|
|
start_period: 5s
|
|
restart: unless-stopped
|
|
|
|
api:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
environment:
|
|
APP_HOST: 0.0.0.0
|
|
APP_PORT: 8080
|
|
LOG_LEVEL: info
|
|
DATABASE_URL: postgresql+psycopg://messenger:${POSTGRES_PASSWORD}@postgres:5432/messenger
|
|
SESSION_TTL_SECONDS: ${SESSION_TTL_SECONDS:-3600}
|
|
ports:
|
|
- "8080:8080"
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
postgres_data: |