version: '3.8'

services:
  postgres:
    image: postgres:16-alpine
    container_name: bidcast-postgres
    restart: unless-stopped
    ports:
      - "5432:5432"
    environment:
      POSTGRES_DB: bidcast
      POSTGRES_USER: bidcast
      POSTGRES_PASSWORD: bidcast_secret
    volumes:
      - bidcast_postgres_data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U bidcast"]
      interval: 5s
      timeout: 5s
      retries: 5

  redis:
    image: redis:7-alpine
    container_name: bidcast-redis
    restart: unless-stopped
    ports:
      - "6379:6379"
    volumes:
      - bidcast_redis_data:/data
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 5s
      timeout: 5s
      retries: 5

volumes:
  bidcast_postgres_data:
  bidcast_redis_data:
