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

Add local-dev compose + build target #90

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ build:
.PHONY: publish
publish:
mvn deploy -Dregistry=https://maven.pkg.github.com/ChameleonCloud

.PHONY: docker-build
docker-build:
docker build . -t keycloak-chameleon --build-arg GITHUB_TOKEN="${GITHUB_TOKEN}" --build-arg RELEASE="${KEYCLOAK_RELEASE}"
46 changes: 46 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Development docker compose
---
version: '3.4'

services:
keycloak:
image: keycloak-chameleon
environment:
KC_DB_URL: jdbc:mysql://keycloak_db:3306/keycloak
KC_DB_USERNAME: keycloak
KC_DB_PASSWORD: keycloak_pass
KEYCLOAK_LOGLEVEL: DEBUG
KEYCLOAK_USER: admin
KEYCLOAK_PASSWORD: admin
KEYCLOAK_ADMIN: admin
KEYCLOAK_ADMIN_PASSWORD: admin
KEYCLOAK_HOSTNAME: localhost
KEYCLOAK_ALWAYS_HTTPS: "true"
PROXY_ADDRESS_FORWARDING: "false"
depends_on:
- keycloak_db
command: start-dev --import-realm
volumes:
- ./realm_exports/:/opt/keycloak/data/import

keycloak_db:
image: mariadb
environment:
MYSQL_DATABASE: keycloak
MYSQL_USER: keycloak
MYSQL_PASSWORD: keycloak_pass
MYSQL_ROOT_PASSWORD: keycloak_pass
volumes:
- mariadb_data:/var/lib/mysql

keycloak_nginx:
image: nginx
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ../certs:/certs
ports:
- "8080:443"

volumes:
mariadb_data:

23 changes: 23 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
events {
worker_connections 1024;
}

http {

server {
listen 443 ssl;

ssl_certificate /certs/chameleon.local.crt;
ssl_certificate_key /certs/chameleon.local.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
ssl_ciphers HIGH:!aNULL:!MD5;

location / {
proxy_pass http://keycloak:8080/;
proxy_set_header X-Forwarded-For $proxy_protocol_addr; # To forward the original client's IP address
proxy_set_header X-Forwarded-Proto $scheme; # to forward the original protocol (HTTP or HTTPS)
proxy_set_header Host $http_host; # to forward the original host requested by the client
proxy_set_header X-Forwarded-Port 8080; # to forward the original port requested by the client
}
}
}
Loading