services:
justapi:
build:
context: .
dockerfile: Dockerfile
ports:
- "8080:8080"
environment:
- RUST_LOG=info
- DATABASE_URL=postgres://justapi:justapi@db:5432/justapi
- REDIS_URL=redis://redis:6379
- JAEGER_AGENT_HOST=jaeger
- JAEGER_AGENT_PORT=6831
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
volumes:
- ./python:/app/python:ro
restart: unless-stopped
db:
image: postgres:16-alpine
environment:
POSTGRES_USER: ${POSTGRES_USER:-justapi}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme}
POSTGRES_DB: ${POSTGRES_DB:-justapi}
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U justapi"]
interval: 5s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
jaeger:
image: jaegertracing/all-in-one:1.62
ports:
- "16686:16686"
- "4318:4318"
- "6831:6831/udp"
environment:
- COLLECTOR_OTLP_ENABLED=true
volumes:
pgdata: