Sample applications used for "Dockerize it all" session during GR8Conf-IN 2016
Source code contains a Springboot CLI application hello.groovy
. To run it locally you need to install springboot CLI tool. You can easily install it using SDKMAN or follow the instrucitons on spring boot website.
Run locally without docker
spring run *.groovy
Build locally which you will do after code changes and before docker build to use latest jar
spring jar hello.jar *.groovy
docker run -v $PWD:/app -p 8080:8080 java:8 java -jar /app/hello.jar
docker build -t bhagwatkumar/hellodocker .
docker push bhagwatkumar/hellodocker
This is written using Springboot and Mongodb dependecy with Spring data rest. You will find all 3 Groovy classes in Application.groovy.
Make sure you execute gradle build
first to use the latest jar file if you have changed demo code.
docker build -t bhagwatkumar/backend dockerBuild
docker-compose up
This is a Nodejs+Angularjs application which depends on Backend app for TODO rest endpoints.
docker build -t bhagwatkumar/frontend .
It depends on localhost
environment variable to find the IP of running backend application. In case of Mac OSX and Windows use docker-machine ip default
to find the IP of host machine.
docker-compose up
There is no need of localhost environment in production mode as respective services is mentioned as link. Try experimenting with changing environment variable for mongodb host to some externally running mongodb server and remove the linking and image defination for mongodb from dcoker-compose.yml. This is what you usually do in production environment.
docker-compose up -d