diff --git a/docker-compose.yml b/docker-compose.yml index 7a179d45..07d44bd0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -117,7 +117,7 @@ services: ${WEBAPP_DOMAIN}: ${WEBAPP_HOST_IP} ${KEYCLOAK_DOMAIN}: ${KC_HOST_IP} ports: - - '80:80' + - '3000:80' logging: options: max-size: '10m' @@ -165,7 +165,7 @@ services: environment: KEYCLOAK_ADMIN: ${KEYCLOAK_ADMIN} KEYCLOAK_ADMIN_PASSWORD: ${KEYCLOAK_ADMIN_PASSWORD} - WEBAPP_ORIGIN: http://${WEBAPP_DOMAIN} + WEBAPP_ORIGIN: http://${WEBAPP_DOMAIN}:3000 KC_HEALTH_ENABLED: true KC_DB: postgres KC_DB_URL: jdbc:postgresql://${PG_DB_HOST}/postgres?currentSchema=keycloak @@ -175,10 +175,14 @@ services: KEYCLOAK_API_CLIENT_SECRET_KEY: ${KEYCLOAK_API_CLIENT_SECRET_KEY} GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID} GOOGLE_CLIENT_SECRET: ${GOOGLE_CLIENT_SECRET} + KC_HOSTNAME_STRICT_HTTPS: 'false' + KC_PROXY: 'edge' + KC_HTTP_ENABLED: 'true' + KC_LOG_LEVEL: ${KC_LOGGING_LEVEL} + PROXY_ADDRESS_FORWARDING: 'true' command: - - start-dev - - --log-level=${KC_LOGGING_LEVEL} - - --import-realm + - start + - --import-realm - --spi-theme-welcome-theme=custom-welcome logging: options: @@ -190,6 +194,15 @@ services: retries: 3 start_period: 30s + nginx: + image: nginx:latest + ports: + - '80:80' + volumes: + - ./nginx.conf:/etc/nginx/nginx.conf + depends_on: + - cvmanager_keycloak + volumes: pgdb: driver: local diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 00000000..650a115d --- /dev/null +++ b/nginx.conf @@ -0,0 +1,16 @@ +events {} + +http { + server { + listen 80; + + location / { + proxy_pass http://cvmanager.auth.com:8084; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Port $server_port; + } + } +} \ No newline at end of file