/spring-boot-docker-buildpacks

Spring Boot Docker with Buildpacks demo project

Primary LanguageKotlinApache License 2.0Apache-2.0

Build a Secure Spring Boot Application and Run It in Docker

#springboot #docker #buildpacks #okta #oauth2 #kotln

This example shows how to bootstrap a Spring Boot application with Okta OAuth 2.0, build it using Buildpacks and run in the Docker - all just in 5 minutes!

Okta has Authentication and User Management APIs that reduce development time with instant-on, scalable user infrastructure. Okta's intuitive API and expert support make it easy for developers to authenticate, manage and secure users and roles in any application.

For further details, please read the tutorial published on Okta Blog.

Prerequisites

Run this application

Clone source code

git clone https://github.com/ruXLab/spring-boot-docker-buildpacks.git

Signup with Okta and create your first application:

okta register
okta apps create

Build application image into local Docker

./gradlew bootBuildImage --imageName=springbootdemo

Create .env file in the project root and put your Okta application parameters from .okta.env file:

OKTA_OAUTH2_ISSUER=https://dev-xxxxxx.okta.com/oauth2/default
OKTA_OAUTH2_CLIENT_SECRET=viVC58i6MzQHzAz9BeXjzhWpSz8qbg6U5B4RXnre
OKTA_OAUTH2_CLIENT_ID=zoa1bzlj7DWmzSI8o5d6

Run your application

docker run -it -p8080:8080 --env-file .env springbootdemo 

Help

Please post any questions as comments on this repo's blog post, or use our Okta Developer Forums.

License

Apache 2.0, see LICENSE.