version: '3'

volumes:
  postgres_data:
    driver: local

services:
  postgres:
    image: postgres
    volumes:
      - postgres_data:/var/lib/postgresql/data_new
    environment:
      POSTGRES_DB: keycloak
      POSTGRES_USER: keycloak
      POSTGRES_PASSWORD: password
  keycloak:
    image: quay.io/keycloak/keycloak:18.0.2-legacy
    environment:
      DB_VENDOR: POSTGRES
      DB_ADDR: postgres
      DB_DATABASE: keycloak
      DB_USER: keycloak
      DB_SCHEMA: public
      DB_PASSWORD: password
      KEYCLOAK_USER: admin
      KEYCLOAK_PASSWORD: Pa55w0rd
      PROXY_ADDRESS_FORWARDING: 'true'
      GITSEARCH_PATH: /home/contDeploy/gitsearch2/gitsearch
      # 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"
    ports:
      - 8082:8080
    volumes:
      - $GITSEARCH_PATH/src/main/resources/keycloak-theme/themes/gitsearch/src/main/resources/keycloak-theme/themes/gitsearch:/opt/jboss/keycloak/themes/gitsearch
    depends_on:
      - postgres
