services:
  postgres:
    image: postgres:17-alpine
    environment:
      POSTGRES_DB: tft_miniapp
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres
    ports:
      - "5434:5432"
    volumes:
      - tft_miniapp_postgres:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U postgres -d tft_miniapp"]
      interval: 5s
      timeout: 3s
      retries: 20

  redis:
    image: redis:8-alpine
    ports:
      - "6380:6379"
    command: ["redis-server", "--appendonly", "yes"]
    volumes:
      - tft_miniapp_redis:/data
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 5s
      timeout: 3s
      retries: 20

volumes:
  tft_miniapp_postgres:
  tft_miniapp_redis:
