-
Notifications
You must be signed in to change notification settings - Fork 9
Create local containerized keycloak docker example, update README #75
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
7ae05eb
Scratch docker impl
jloux-brapi 3511979
Create local containerized keycloak docker example, update README
jloux-brapi f1d8d35
Update README
jloux-brapi b3c3fa0
Reinstate v1 service for original compose, remove ports, remove volume
jloux-brapi 5b044ec
Add note about DB IDs to README
jloux-brapi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,15 @@ | ||
| # build image : `docker build -t brapicoordinatorselby/brapi-java-server ./` | ||
| # run container (dev): `docker run --name=brapi-test-server --network=bridge -p 8081:8081 -d brapicoordinatorselby/brapi-java-server` | ||
| # run container (prod): `docker run --name=brapi-test-server --restart always --network=brapi_net -d brapicoordinatorselby/brapi-java-server` | ||
| # build image stack: `docker build -t docker-username/image-stack-name ./` | ||
| # run container (dev): `docker run --name=brapi-test-server --network=bridge -p 8081:8081 -d docker-username/image-stack-name` | ||
| # run container (prod): `docker run --name=brapi-test-server --restart always --network=brapi_net -d docker-username/image-stack-name` | ||
|
|
||
| FROM adoptopenjdk/openjdk8 | ||
|
|
||
| EXPOSE 8080 | ||
| # 8080 - brapi app port | 5005 - brapi app debug port | 8008 - keycloak app port | ||
| EXPOSE 8080 5005 8008 | ||
|
|
||
| RUN mkdir /home/brapi | ||
|
|
||
| COPY target/brapi-Java-TestServer-0.1.0.jar src/main/resources/ /home/brapi/ | ||
|
|
||
| CMD java -cp "/home/brapi/:/home/brapi/brapi-Java-TestServer-0.1.0.jar" org.springframework.boot.loader.JarLauncher | ||
| # Open up debug port on JVM | ||
| CMD java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=0.0.0.0:5005 -cp "/home/brapi/:/home/brapi/brapi-Java-TestServer-0.1.0.jar" org.springframework.boot.loader.JarLauncher |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| services: | ||
| brapi-java-server-v2: | ||
| build: | ||
| context: . | ||
| dockerfile: Dockerfile | ||
| ports: | ||
| - "8080:8080" | ||
| - "5005:5005" | ||
| depends_on: | ||
| - brapi-db | ||
| volumes: | ||
| - .\src\main\resources\properties\application.properties:/home/brapi/properties/application.properties | ||
| brapi-db: | ||
| image: postgres:13 | ||
| environment: | ||
| POSTGRES_USER: brapi | ||
| POSTGRES_PASSWORD: password | ||
| volumes: | ||
| - /var/lib/postgresql/data | ||
| ports: | ||
| - "5433:5432" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| services: | ||
| brapi-java-server-v2: | ||
| build: | ||
| context: . | ||
| dockerfile: Dockerfile | ||
| ports: | ||
| - "8080:8080" | ||
| - "5005:5005" | ||
| depends_on: | ||
| - brapi-db | ||
| volumes: | ||
| - .\src\main\resources\properties\application.properties:/home/brapi/properties/application.properties | ||
| keycloak-brapi: | ||
| image: quay.io/keycloak/keycloak:latest | ||
| entrypoint: /opt/keycloak/bin/kc.sh start-dev | ||
| depends_on: | ||
| - keycloak-db | ||
| environment: | ||
| - KEYCLOAK_USER=admin | ||
| - KEYCLOAK_PASSWORD=admin | ||
| # The KC_HOSTNAME needs to be the same as the defined keycloak-brapi service in the compose file for a local setup. | ||
| # This allows the brapi app to talk to the keycloak container via the service name in the url, and sets up keycloak | ||
| # url defaults so that when brapi gets auth urls from keycloak it can still talk to it. | ||
| - KC_HOSTNAME=keycloak-brapi | ||
| - KC_DB=postgres | ||
| - KC_DB_URL=jdbc:postgresql://keycloak-db:5432/keycloak | ||
| - KC_DB_SCHEMA=public | ||
| - KC_DB_USERNAME=keycloak | ||
| - KC_DB_PASSWORD=password | ||
| - KC_HOSTNAME_STRICT=false | ||
| - KC_HOSTNAME_STRICT_HTTPS=false | ||
| - KC_HTTP_PORT=8008 | ||
|
|
||
| - KC_LOG_LEVEL=info | ||
| - KC_METRICS_ENABLED=true | ||
| - KC_HEALTH_ENABLED=true | ||
| - KEYCLOAK_ADMIN=admin | ||
| - KEYCLOAK_ADMIN_PASSWORD=admin | ||
| ports: | ||
| - "8008:8008" | ||
| brapi-db: | ||
| image: postgres:13 | ||
| environment: | ||
| POSTGRES_USER: brapi | ||
| POSTGRES_PASSWORD: password | ||
| volumes: | ||
| - brapi-data:/var/lib/postgresql/data | ||
| ports: | ||
| - "5433:5432" | ||
| keycloak-db: | ||
| image: postgres:13 | ||
| volumes: | ||
| - keycloak-data:/var/lib/postgresql/data | ||
| environment: | ||
| POSTGRES_USER: keycloak | ||
| POSTGRES_PASSWORD: password | ||
| ports: | ||
| - "5434:5432" | ||
| volumes: | ||
| keycloak-data: | ||
| brapi-data: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this service needs to stay
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done