name: phono

services:
  pg:
    image: postgres:18rc1
    restart: always
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: guest
    ports:
      - "127.0.0.1:5432:5432"
    volumes:
      - "./docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d:ro"
      - "./pgdata:/var/lib/postgresql/18/docker"

  keycloak:
    depends_on: [pg]
    restart: always
    build:
      context: .
      dockerfile: keycloak.dockerfile
    environment:
      KC_DB: postgres
      KC_DB_URL: jdbc:postgresql://pg:5432/keycloak
      KC_DB_USERNAME: keycloak
      KC_DB_PASSWORD: guest
      KC_HOSTNAME: 0.0.0.0
      KEYCLOAK_ADMIN: admin
      KEYCLOAK_ADMIN_PASSWORD: guest
    command: [start, --optimized]
    ports:
      - "127.0.0.1:9000:9000"
      - "127.0.0.1:8443:8443"

