version: '3'
# do not uncomment: test.wo-da.de
# volumes:
#   postgres_data:
#       driver: local

services:
  postgres:
      image: postgres
      volumes:
        - /var/dev/keycloak/postgres_data:/var/lib/postgresql/data
      environment:
        POSTGRES_DB: keycloak
        POSTGRES_USER: keycloak
        POSTGRES_PASSWORD: password
  keycloak:
      image: jboss/keycloak
      build: .
      # command: ["-Djboss.socket.binding.port-offset=1000"]
      volumes:
        - ./standalone-ha.xml:/opt/jboss/keycloak/standalone/configuration/standalone-ha.xml
        - ./standalone.xml:/opt/jboss/keycloak/standalone/configuration/standalone.xml
        - ./domain.xml:/opt/jboss/keycloak/domain/configuration/domain.xml
        - ./themes/shifterNetwork:/opt/jboss/keycloak/themes/shifterNetwork
      environment:
        DB_VENDOR: POSTGRES
        DB_ADDR: postgres
        DB_DATABASE: keycloak
        DB_USER: keycloak
        DB_SCHEMA: public
        DB_PASSWORD: password
        KEYCLOAK_USER: admin
        KEYCLOAK_PASSWORD: admin
        PROXY_ADDRESS_FORWARDING: "true"
        # Uncomment the line below if you want to specify JDBC parameters. The parameter below is just an example, and it shouldn't be used in production without knowledge. It is highly recommended that you read the PostgreSQL JDBC driver documentation in order to use it.
        #JDBC_PARAMS: "ssl=true"
      # expose:
      #   - 9080
      ports:
        - 9080:9080
        - 9443:9443
        - 9990:9990
      depends_on:
        - postgres

  # snet-app:
  #   build: /var/dev/EAMD.ucp/3rdPartyComponents/tech/jhipster/JHipster/6.10.5/src/docker/1.1.0/
  #   container_name: snet-app
  #   environment:
  #     # - _JAVA_OPTIONS=-Xmx512m -Xms256m
  #     # - SPRING_PROFILES_ACTIVE=prod,swagger
  #     # - SERVER_PORT=9081
  #     # - MANAGEMENT_METRICS_EXPORT_PROMETHEUS_ENABLED=true
  #     # - SPRING_DATASOURCE_URL=jdbc:postgresql://postgres:5432/jhipster
  #     # - SPRING_DATASOURCE_USERNAME=shifternetzwerk
  #     # - SPRING_DATASOURCE_PASSWORD=
  #     # - SPRING_SECURITY_OAUTH2_CLIENT_PROVIDER_OIDC_ISSUER_URI=http://test.wo-da.de:9080/auth/admin
  #     # - SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_OIDC_CLIENT_ID=web_app
  #     # - SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_OIDC_CLIENT_SECRET=web_app
  #     # - JHIPSTER_SLEEP=30 # gives time for other services to boot before the application
  #     - _JAVA_OPTIONS=-Xmx512m -Xms256m
  #     - NODE_CLIENT_PROVIDER_OIDC_ISSUER_URI=http://test.wo-da.de:9080/auth/realms/jhipster
  #     - BACKEND_ENV=dev
  #   ports:
  #     - 9081:9081
