diff --git a/docker-compose.yml b/docker-compose.yml index f96b1fe..8a80fab 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,16 +1,5 @@ version: '3.8' -x-app-common: &odc_app - build: . - environment: - APACHE_DOCUMENT_ROOT: "public/" - PHP_EXTENSION_XDEBUG: "1" - PHP_INI_MEMORY_LIMIT: "1G" - PHP_EXTENSION_LDAP: 1 - PHP_EXTENSION_INTL: 1 - MAILER_DSN: ${MAILER_DSN} - - services: traefik-odc: image: "traefik:v2.5" @@ -41,7 +30,7 @@ services: - "traefik.http.routers.http-catchall.middlewares=redirect-to-https@docker" - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https" - - "traefik.http.routers.traefik-odc.rule=Host(`traefik.${PUBLIC_URL}`)" + - "traefik.http.routers.traefik-odc.rule=Host(`traefik.`)" - "traefik.http.routers.traefik-odc.entrypoints=web" - "traefik.http.routers.traefik-odc.tls.certresolver=letsencrypt" - "traefik.http.routers.traefik-odc.service=api@internal" @@ -67,19 +56,17 @@ services: restart: unless-stopped environment: - DATABASE_URL: mysql://odc:${ODC_DB_PW}@${RANDOMTAG}db-odc:3306/odc + DATABASE_URL: mysql://odc:@db-odc:3306/odc OAUTH_KEYCLOAK_CLIENT_ID: opendatenschutzcenter - OAUTH_KEYCLOAK_CLIENT_SECRET: ${OAUTH_KEYCLOAK_CLIENT_SECRET} - OAUTH_KEYCLOAK_SERVER: ${HTTP_METHOD}://${PUBLIC_URL}/keycloak + OAUTH_KEYCLOAK_CLIENT_SECRET: + OAUTH_KEYCLOAK_SERVER: /keycloak OAUTH_KEYCLOAK_REALM: opendatenschutzcenter - MAILER_DSN: ${MAILER_DSN} - laF_version: ${GIT_VERSION} - registerEmailAdress: ${registerEmailAdress} - DEFAULT_EMAIL: ${registerEmailAdress} + MAILER_DSN: smtp://null + laF_version: 3.0.4 labels: - "traefik.enable=true" - "traefik.http.routers.app-odc.tls=true" - - "traefik.http.routers.app-odc.rule=Host(`${PUBLIC_URL}`)" + - "traefik.http.routers.app-odc.rule=Host(``)" - "traefik.http.routers.app-odc.entrypoints=web" - "traefik.http.services.app-odc.loadbalancer.server.port=8080" - "traefik.http.routers.app-odc.tls.certresolver=letsencrypt" @@ -93,7 +80,7 @@ services: db-odc: image: mariadb:latest - hostname: ${RANDOMTAG}db-odc + hostname: db-odc healthcheck: test: [ "CMD", "mariadb-admin" ,"ping", "-h", "localhost","-ptest" ] timeout: 20s @@ -112,14 +99,14 @@ services: condition: service_healthy environment: KEYCLOAK_ADMIN: admin - KEYCLOAK_ADMIN_PASSWORD: ${KEYCLOAK_ADMIN_PW} + KEYCLOAK_ADMIN_PASSWORD: KC_DB: mariadb - KC_DB_PASSWORD: ${KEYCLOAK_PW} - KC_DB_URL: jdbc:mariadb://${RANDOMTAG}db-odc:3306/keycloak + KC_DB_PASSWORD: + KC_DB_URL: jdbc:mariadb://db-odc:3306/keycloak KC_DB_USERNAME: keycloak - KC_HOSTNAME_URL: ${HTTP_METHOD}://${PUBLIC_URL}/keycloak - KC_HOSTNAME_PATH: ${HTTP_METHOD}://${PUBLIC_URL}/keycloak - KC_HOSTNAME_ADMIN_URL: ${HTTP_METHOD}://${PUBLIC_URL}/keycloak + KC_HOSTNAME_URL: /keycloak + KC_HOSTNAME_PATH: /keycloak + KC_HOSTNAME_ADMIN_URL: /keycloak KC_HTTP_RELATIVE_PATH: /keycloak KC_PROXY: passthrough @@ -129,7 +116,7 @@ services: labels: - "traefik.enable=true" - "traefik.http.routers.keycloak-odc.tls=true" - - "traefik.http.routers.keycloak-odc.rule=Host(`${PUBLIC_URL}`) && PathPrefix(`/keycloak`)" + - "traefik.http.routers.keycloak-odc.rule=Host(``) && PathPrefix(`/keycloak`)" - "traefik.http.routers.keycloak-odc.entrypoints=web" - "traefik.http.services.keycloak-odc.loadbalancer.server.port=8080" - "traefik.http.routers.keycloak-odc.tls.certresolver=letsencrypt" diff --git a/setup.sh b/setup.sh index f79cbec..ccf67a0 100644 --- a/setup.sh +++ b/setup.sh @@ -50,3 +50,13 @@ echo ------------------------------------------------------------ sed -i "s||$ODC_DB_PW|g" mysql-initdb/init-userdb.sql sed -i "s||$KEYCLOAK_PW|g" mysql-initdb/init-userdb.sql + +echo ------------------------------------------------------------ +echo ----------------- Build Docker Compose File ---------------- +echo ------------------------------------------------------------ + +sed -i "s||$KEYCLOAK_ADMIN_PW|g" docker-compose.yml +sed -i "s||$KEYCLOAK_PW|g" docker-compose.yml +sed -i "s||$OAUTH_KEYCLOAK_CLIENT_ID|g" docker-compose.yml +sed -i "s||$HTTP_METHOD://$PUBLIC_URL|g" docker-compose.yml +sed -i "s||$ODC_DB_PW|g" docker-compose.yml