# Local infrastructure only (Postgres + Redis).
# The app itself runs on the host via `npm run dev` for fast iteration.
services:
  postgres:
    image: postgres:16-alpine
    container_name: support-chat-pg
    restart: unless-stopped
    environment:
      POSTGRES_USER: support
      POSTGRES_PASSWORD: support
      POSTGRES_DB: support_chat
    ports: ["5432:5432"]
    volumes:
      - pgdata:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U support -d support_chat"]
      interval: 5s
      timeout: 5s
      retries: 10

  redis:
    image: redis:7-alpine
    container_name: support-chat-redis
    restart: unless-stopped
    command: ["redis-server", "--appendonly", "yes"]
    ports: ["6379:6379"]
    volumes:
      - redisdata:/data
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 5s
      timeout: 5s
      retries: 10

volumes:
  pgdata:
  redisdata:
