File tree 2 files changed +16
-22
lines changed
2 files changed +16
-22
lines changed Original file line number Diff line number Diff line change 1
- FROM java:8
1
+ FROM java:8 AS BUILD
2
+ ENV APP_HOME=/root/code/
3
+ RUN rm -rf $APP_HOME
4
+ RUN mkdir -p $APP_HOME
5
+ WORKDIR $APP_HOME
6
+
7
+ # Prepare by downloading dependencies
8
+ ADD pom.xml $APP_HOME/pom.xml
9
+
10
+ # Adding source, compile and package into a fat jar
11
+ ADD src $APP_HOME/src
2
12
3
13
# Install maven
4
14
RUN apt-get update
5
15
RUN apt-get install -y maven
6
16
7
- WORKDIR /code
8
-
9
- # Prepare by downloading dependencies
10
- ADD pom.xml /code/pom.xml
11
-
12
- # Adding source, compile and package into a fat jar
13
- ADD src /code/src
14
17
RUN ["mvn" , "dependency:resolve" ]
15
18
RUN ["mvn" , "verify" ]
16
19
RUN ["mvn" , "clean" ]
17
20
RUN ["mvn" , "package" ]
18
21
19
- WORKDIR /code
20
-
21
- RUN curl -O http://archive.apache.org/dist/tomcat/tomcat-8/v8.5.9/bin/apache-tomcat-8.5.9.tar.gz
22
- RUN tar xzf apache-tomcat-8.5.9.tar.gz
23
-
24
- WORKDIR /code
25
-
26
- COPY /code/src/main/webapp/index.jsp apache-tomcat-8.5.9/webapps/
27
-
22
+ FROM tomcat:8.0.20-jre8
23
+ # WORKDIR /root/
28
24
EXPOSE 8080
29
25
30
- CMD apache-tomcat-8.5.9/bin/startup.sh && tail -f apache-tomcat-8.5.9/logs/catalina.out
26
+ COPY --from=BUILD /root/code/target/*.war /usr/local/tomcat/webapps/simplewebapp.war
27
+
28
+ CMD /usr/local/tomcat/bin/startup.sh && tail -f /usr/local/tomcat/logs/catalina.out
Original file line number Diff line number Diff line change 24
24
<plugin >
25
25
<artifactId >maven-war-plugin</artifactId >
26
26
<version >2.6</version >
27
- <configuration >
28
- <failOnMissingWebXml >false</failOnMissingWebXml >
29
- <warName >simplewebapp</warName >
30
- </configuration >
31
27
</plugin >
32
28
</plugins >
33
29
</build >
You can’t perform that action at this time.
0 commit comments