Note: THIS GUIDE IS NOT TESTED YET! The following steps are meant to create an environment for deploying app with tomcat and mysql with a war file. Assuming you are using Linux. For the Mac local version, please go here.
-
Install Docker following the guild here.
-
Go here and follow the step there to get the mysql image/Dockerfile. It's a good idea to create a new empaty folder for the files from the repo. Replace the "XXXXXXXX" with desired username/password.
$ sudo docker run -d --name db -e MYSQL_USER="XXXXXXXX" -e MYSQL_PASSWORD="XXXXXXXX" -e MYSQL_ROOT_PASSWORD="XXXXXXXX" -e MYSQL_DATABASE="rekomendi" -p 3306:3306 mysql
- Go here and follow the step there to build the tomcat image. It's a good idea to create a new empaty folder for the files from the repo. Also, you should put the war files you want to deploy in this folder.
$ sudo docker build -t tutum/tomcat .
Then link it with the mysql we created earlier.
$ sudo docker run -d -p 8080:8080 --name web-sql --link rek-mysql:mysql tutum/tomcat
- Now /*hopefully*/ you are able to access [server ip]:8080/rekomendi-cockpit
Note: The port mapping is highly customizable.