version: '3.8'

services:
  keycloak:
    image: quay.io/keycloak/keycloak:23.0.0
    container_name: unionflow-keycloak
    environment:
      KEYCLOAK_ADMIN: admin
      KEYCLOAK_ADMIN_PASSWORD: admin123
      KC_DB: postgres
      KC_DB_URL: jdbc:postgresql://postgres:5432/keycloak
      KC_DB_USERNAME: keycloak
      KC_DB_PASSWORD: keycloak123
      KC_HOSTNAME: 192.168.1.145
      KC_HOSTNAME_PORT: 8180
      KC_HTTP_ENABLED: true
      KC_HTTP_PORT: 8180
      KC_HOSTNAME_STRICT: false
      KC_HOSTNAME_STRICT_HTTPS: false
    ports:
      - "8180:8180"
    depends_on:
      - postgres
    command: start --optimized
    networks:
      - unionflow-network

  postgres:
    image: postgres:15
    container_name: unionflow-postgres
    environment:
      POSTGRES_DB: keycloak
      POSTGRES_USER: keycloak
      POSTGRES_PASSWORD: keycloak123
    volumes:
      - postgres_data:/var/lib/postgresql/data
    ports:
      - "5432:5432"
    networks:
      - unionflow-network

volumes:
  postgres_data:

networks:
  unionflow-network:
    driver: bridge
