First of all, we will introduce the play framework. Play is an open source web application framework, written in Scala and Java and it was divided into two different incompatible branches, 1.X (adopted Java) and 2.X (adopted Scala). The main advantage of play framework is it follows model-view-controller(MVC) pattern which let program maintain web application easily. No mattern which branches you used, first of all, we need to install Java into our docker container.
Due to container being a light os system, we need to install some useful tools, such as vim, to help us to manipulate the system.
$ sudo apt-get install git wget vim ssh
$ sudo apt-get update
$ sudo apt-get install default-jdk
Due to container being a light os system, we need to install some useful tool to help us to manipulate the system.
Before installing java, you need to install python to let your system can use add-apt-repository commands. First of all, you need to use the commands:
$ sudo apt-get install software-properties-common
Then use the following commands:
$ sudo apt-get install python-software-properties
First of all, you need to add WebUPD8 repository
$ sudo add-apt-repository ppa:webupd8team/java
Then use following commands to install Java.
$ sudo apt-get update
$ sudo apt-get install oracle-java7-installer
Then, you install java in your docker images.
First of all, you need to go to playframework's download page. Next, we use unzip package to decompress the file.
After getting playframework package, we need to add the $PATH to the environment variable.
$ export /{play-version}:$PATH
Finally, we need to create a play project:
$ play new myFirstPlay
Then use the commands to run this project
$ play run