version: '3.8' services: db: image: postgres:16-alpine container_name: mtusi_messenger_db environment: POSTGRES_USER: ${POSTGRES_USER} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} POSTGRES_DB: ${POSTGRES_DB} volumes: - postgres_data:/var/lib/postgresql/data ports: - "5432:5432" healthcheck: test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER}"] interval: 5s timeout: 5s retries: 5 restart: unless-stopped redis: image: redis:7-alpine container_name: mtusi_messenger_redis command: redis-server --appendonly yes volumes: - redis_data:/data ports: - "6379:6379" healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 5s timeout: 3s retries: 5 restart: unless-stopped app: build: . container_name: mtusi_messenger_app environment: DATABASE_URL: ${DATABASE_URL} REDIS_URL: ${REDIS_URL} SESSION_TTL_SECONDS: ${SESSION_TTL_SECONDS} ports: - "127.0.0.1:8080:8080" depends_on: db: condition: service_healthy redis: condition: service_healthy volumes: - ./app:/app/app - ./alembic:/app/alembic - ./alembic.ini:/app/alembic.ini volumes: postgres_data: redis_data: