diff --git a/docker-compose.yml b/docker-compose.yml index 3c0e61d..fe9f253 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -45,3 +45,46 @@ services: restart: always volumes: - ${FRONTEND_PUBLISH_PATH}:/usr/src/app/mount + + mss-keycloak: + container_name: mss-keycloak + image: quay.io/keycloak/keycloak:latest + restart: on-failure + environment: + KEYCLOAK_ADMIN: ${KEYCLOAK_ADMIN} + KEYCLOAK_ADMIN_PASSWORD: ${KEYCLOAK_ADMIN_PASSWORD} + KC_DB: postgres + KC_DB_URL: jdbc:postgresql://mss-keycloak-postgres:5432/${KEYCLOAK_POSTGRES_DB} + KC_DB_USERNAME: ${KEYCLOAK_POSTGRES_USER} + KC_DB_PASSWORD: ${KEYCLOAK_POSTGRES_PASSWORD} + KC_HOSTNAME: mirea.xyz + KC_HOSTNAME_PORT: ${KEYCLOAK_PUBLISH_PORT} + KC_HOSTNAME_STRICT_BACKCHANNEL: "true" + KC_HTTP_ENABLED: "true" + KC_LOG_LEVEL: warn + KC_PROXY: none + ports: + - 127.0.0.1:${KEYCLOAK_PUBLISH_PORT}:8443 + depends_on: + - mss-keycloak-postgres + volumes: + - ./keycloak/keycloak.conf:/opt/keycloak/conf/keycloak.conf + - ${KEYCLOAK_PUBLIC_CERT_FILE_PATH}:/opt/keycloak/conf/public.crt:ro + - ${KEYCLOAK_PRIVATE_KEY_FILE_PATH}:/opt/keycloak/conf/private.key:ro + command: + - start + - --https-certificate-file=/opt/keycloak/conf/public.crt + - --https-certificate-key-file=/opt/keycloak/conf/private.key + + mss-keycloak-postgres: + container_name: mss-keycloak-postgres + image: postgres:16-alpine + restart: on-failure + environment: + PGDATA: "/var/lib/postgresql/data/pgdata" + POSTGRES_DB: ${KEYCLOAK_POSTGRES_DB} + POSTGRES_USER: ${KEYCLOAK_POSTGRES_USER} + POSTGRES_PASSWORD: ${KEYCLOAK_POSTGRES_PASSWORD} + volumes: + - mss-keycloak-postgres:/var/lib/postgresql/data + - ./keycloak/postgresql.conf:/etc/postgresql/postgresql.conf diff --git a/keycloak/.gitignore b/keycloak/.gitignore new file mode 100644 index 0000000..7313734 --- /dev/null +++ b/keycloak/.gitignore @@ -0,0 +1 @@ +*.dev* \ No newline at end of file diff --git a/keycloak/keycloak.conf b/keycloak/keycloak.conf new file mode 100644 index 0000000..db34d29 --- /dev/null +++ b/keycloak/keycloak.conf @@ -0,0 +1 @@ +quarkus.transaction-manager.enable-recovery=true \ No newline at end of file diff --git a/keycloak/postgresql.conf b/keycloak/postgresql.conf new file mode 100644 index 0000000..c6ea83f --- /dev/null +++ b/keycloak/postgresql.conf @@ -0,0 +1,7 @@ +# ----------------------------- +# PostgreSQL configuration file +# ----------------------------- + +# From sample /usr/local/share/postgresql/postgresql.conf.sample + +listen_addresses = '*'