Docker publish and deploy, cheat sheet
In the post Cheap and easy DevOps for developers I described the architecture of the deployment with the focus on the configuration of the proxy.
Here a cheatsheet of the operations that I execute to deploy the Angular & Java application from the client to the server (angular.cafe).
On the client:
-
compile the application, from the parent module:
mvn clean install
-
build the image, from the directory that contains the Docker configuration:
docker build -t javaee/angular2-java-hello-world .
-
push the image to dockerhub:
docker push javaee/angular2-java-hello-world:latest
On the server that hosts the application:
-
get the image:
docker pull javaee/angular2-java-hello-world
-
stop the running image, angular is the name of the image:
docker stop angular
-
remove the image:
docker rm angular
-
run the new image:
docker run --name angular -d -p 8080:8082 javaee/angular2-java-hello-world