Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supporting Production Keycloak #161

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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
16 changes: 16 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -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;
}
}
}
Loading