version: '3.9'

services:
  postgres:
    image: postgres:16-alpine
    container_name: syndsol-postgres
    restart: unless-stopped
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres
      POSTGRES_DB: syndiclub
    ports:
      - '5433:5432'  # 5433 to avoid conflict with ServBay's Postgres on 5432
    volumes:
      - pgdata:/var/lib/postgresql/data
    healthcheck:
      test: ['CMD-SHELL', 'pg_isready -U postgres -d syndiclub']
      interval: 5s
      retries: 10

  redis:
    image: redis:7-alpine
    container_name: syndsol-redis
    restart: unless-stopped
    ports:
      - '6379:6379'

volumes:
  pgdata:
