Browse code

add Dockerfile

devnewton authored on 09/03/2017 at 21:22:49
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,26 @@
0
+FROM java:8
1
+
2
+# Update apt
3
+RUN apt-get update
4
+
5
+# Install mongodb
6
+RUN apt-get install -y mongodb-server
7
+RUN service mongodb start
8
+
9
+# Install maven
10
+RUN apt-get install -y maven
11
+
12
+WORKDIR /code
13
+
14
+# Prepare by downloading dependencies
15
+ADD pom.xml /code/pom.xml
16
+RUN ["mvn", "dependency:resolve"]
17
+RUN ["mvn", "verify"]
18
+
19
+# Adding source, compile and package into a fat jar
20
+ADD src /code/src
21
+RUN ["mvn", "package"]
22
+
23
+EXPOSE 27017
24
+EXPOSE 8080
25
+ENTRYPOINT service mongodb start && java -jar target/jb3-1.0-SNAPSHOT.jar
0 26
\ No newline at end of file