services:
  postgres:
    image: postgres:17-alpine
    container_name: baron_postgres
    environment:
      POSTGRES_USER: ${DB_USER:-baron}
      POSTGRES_PASSWORD: ${DB_PASSWORD:-password}
      POSTGRES_DB: ${DB_NAME:-baron_sso}
    ports:
      - "${DB_PORT:-5432}:5432"
    volumes:
      - postgres_data:/var/lib/postgresql/data
    networks:
      - baron_net
    restart: always

  clickhouse:
    image: clickhouse/clickhouse-server:latest
    container_name: baron_clickhouse
    environment:
      CLICKHOUSE_USER: ${CLICKHOUSE_USER:-baron}
      CLICKHOUSE_PASSWORD: ${CLICKHOUSE_PASSWORD:-password}
    networks:
      - baron_net

  redis:
    image: redis:7-alpine
    container_name: baron_redis
    restart: always
    command: redis-server --port 6399
    ports:
      - "6399:6399"
    volumes:
      - redis_data:/data
    networks:
      - baron_net

volumes:
  postgres_data:
  clickhouse_data:
  redis_data:

networks:
  baron_net:
    name: baron_network
    driver: bridge
