-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
51 lines (38 loc) · 1.46 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
FROM ubuntu:14.04
RUN echo "deb http://archive.ubuntu.com/ubuntu trusty main universe" > /etc/apt/sources.list
# update apt repositories
RUN apt-get update
#Install common repositories, unzip and git
RUN apt-get -y install software-properties-common
RUN apt-get install unzip
RUN apt-get install -y wget git
#Install java
RUN \
echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \
add-apt-repository -y ppa:webupd8team/java && \
apt-get update && \
apt-get install -y oracle-java8-installer && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /var/cache/oracle-jdk8-installer
#Install sbt
RUN \
wget https://dl.bintray.com/sbt/debian/sbt-0.13.6.deb && \
dpkg -i sbt-0.13.6.deb && \
apt-get update && \
sudo apt-get install -y sbt
ENV JAVA_HOME /usr/lib/jvm/java-8-oracle
EXPOSE 9217
#Clone my-app and build it
RUN \
cd ../usr/src && \
git clone https://github.com/AMileikis/play-scala-docker.git && \
cd play-scala-docker/my-app && \
sbt dist
RUN mkdir -p /usr/src/play-scala-docker/app
RUN mv /usr/src/play-scala-docker/my-app/target/universal/my-app-1.0.0-SNAPSHOT.zip /usr/src/play-scala-docker/app
#Unzip the build, remove the leftover zip file
RUN cd /usr/src/play-scala-docker/app && \
unzip my-app-1.0.0-SNAPSHOT.zip && \
rm *.zip
#At run-time, this command is executed - run the application on port 9217
CMD /usr/src/play-scala-docker/app/my-app-1.0.0-SNAPSHOT/bin/my-app -Dhttp.port=9217