Skip to content

Create local containerized keycloak docker example, update README#75

Merged
jloux-brapi merged 5 commits intobrapi-server-v2from
keycloak-dev-docker
Dec 16, 2024
Merged

Create local containerized keycloak docker example, update README#75
jloux-brapi merged 5 commits intobrapi-server-v2from
keycloak-dev-docker

Conversation

@jloux-brapi
Copy link
Contributor

Quite a few things done here:

  • Created a simple docker-compose-dev.yaml set up for local development without authentication to allow developers to stand up the app in docker effortlessly
  • Created a more complex docker-compose-local-auth.yaml that has a self-contained authentication service that connects to a user database that is also containerized. This should allow developers interested in standing up their own auth system with their brapi implementation to explore options.
  • Updated the README to support:
    • Running these two new container implementations
    • Added prerequisites section
    • Added a section explaining how to configure the authentication of the BrAPI server, and specifically how to configure it to hit the sample BrAPI OAuth service we provide at https://brapi.org/oauth, and a link to @BrapiCoordinatorSelby's detailed documentation on all of this.
    • How to configure keycloak for the OAuth authentication that BrAPI supports and get user tokens to test with.
    • Details on how to send a request with authentication to BrAPI
    • Details on how to test the server once it's up and running
    • Details on how to Debug the test server with just a normal java run and when it's running in docker.
  • Updated the application.properties.template to support a new property, security.issuer_url, which allows developers to set the issuer url for their generated tokens.
  • Updated the Dockerfile to expose port 5005 for debugging the brapi app in a dockerized environment.

version: '3'

services:
brapi-java-server-v1:

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

ports:
- "8080:8080"
# Expose DEBUG port
- "5005:5005"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

8080 should not be exposed for the production server, all traffic should go through the rev-proxy service

5005 probably shouldn't be exposed... I'm not sure. It could be handy to have a public debug port open, but it would technically be unprotected access to live code ...

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should see if there is a way to only expose 5005 through an ssh tunnel or something similar. I don't know how to do that off the top of my head, maybe a project for another day

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed these.

ports:
- "5433:5432"
volumes:
brapi-data:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't need this extra volumes section?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

Copy link
Member

@BrapiCoordinatorSelby BrapiCoordinatorSelby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comments

@jloux-brapi jloux-brapi merged commit c37608c into brapi-server-v2 Dec 16, 2024
@jloux-brapi jloux-brapi deleted the keycloak-dev-docker branch December 16, 2024 16:37
jloux-brapi added a commit to plantbreeding/brapi-Java-ProdServer that referenced this pull request Dec 19, 2024
…ocker

Create local containerized keycloak docker example, update README
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants