version: "3.3"

volumes:
  postgres_data:
    driver: local

services:
  postgres:
    hostname: postgres
    image: postgres:11
    volumes:
      - postgres_data:/var/lib/postgresql/data
    environment:
      POSTGRES_DB: keycloak
      POSTGRES_USER: keycloak
      POSTGRES_PASSWORD: keycloak
  auth-server:
    image: demo2.cabal.coop.py:5000/cabalpy/keycloak:1.0.0
    hostname: keycloak
    environment:
      REALM_NAME: mdw
      PROXY_ADDRESS_FORWARDING: "true"
      DB_VENDOR: POSTGRES
      DB_ADDR: postgres
      DB_DATABASE: keycloak
      DB_USER: keycloak
      DB_SCHEMA: public
      DB_PASSWORD: keycloak
      KEYCLOAK_USER: admin
      KEYCLOAK_PASSWORD: 12345
    command:
      [
        "-Dkeycloak.migration.action=import",
        "-Dkeycloak.migration.provider=dir",
        "-Dkeycloak.migration.dir=/import",
        "-Dkeycloak.profile.feature.upload_scripts=enabled",
        "-Dkeycloak.migration.strategy=IGNORE_EXISTING",
      ]
    volumes:
      - ./api-key-ear/import:/import
    ports:
      - "8087:8080"
  dashboard-service:
    image: demo2.cabal.coop.py:5000/cabalpy/dashboard-service:1.0.0
    hostname: dashboard
    environment:
      REALM_NAME: mdw
      AUTH_SERVER_URL: 10.5.1.30:9087
    ports:
      - "8180:8180"
