-
Notifications
You must be signed in to change notification settings - Fork 0
Deployment
Saulo Aguiar edited this page Jul 4, 2017
·
5 revisions
The task is being approach in these steps:
- Gradle task to create uberjar
- Using this gist as starting point
- MyKong also helped
- Append 'Kt' to file name as suggested in the Kotlin discussion forums
- We're still missing
META-INF/spring.factories
in running time [6/12] - Add jpa datasource
- Gradle has a task for it - bootRepackage
- Build the docker container
- Created the Dockerfile
- Followed sample from postgres
- Spantree blog post on docker and tips to create a dockerfile.
- Docker Compose in 12 minutes
- Docker Getting Started and Docker-Compose getting started sections were fundamental to get a better grasp of the overall procedure.
- This spring-boot-docker-mysql repo was a good source of knowledge for the whole task.
- We start both containers (postgres and application) using
docker run
command.- For postgres we have:
docker run --name database -p 8000:5432 -d postgres
- For the application, we need to build the container:
docker build -t application .
and the start it:docker run -p 8080:8080 --link postgres:postgres -v ~/projects/demo:/usr/local/application-data -v ~/.gradle/:/root/.gradle/ application
- For postgres we have:
- The values in the
application.properties
file were updated to reflect the link address made available by the --link option in the docker run command
- Shell script
- Calls the gradle tool inside the container to build the application from kotlin source
- Executes the application