Skip to content

Commit d8590a5

Browse files
committed
added maven compile into dockerfile
1 parent 6df807d commit d8590a5

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

Dockerfile

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
1+
# setup working directory
2+
FROM maven AS build
3+
RUN mkdir /app
4+
WORKDIR /app
5+
6+
# maven build
7+
COPY src /app/src
8+
COPY pom.xml /app
9+
RUN mvn -f /app/pom.xml clean package
10+
11+
# deploy to tomcat
112
FROM tomcat
2-
COPY target/simplewebapp.war /usr/local/tomcat/webapps
13+
COPY --from=build app/target/simplewebapp.war /usr/local/tomcat/webapps
314
EXPOSE 8080
415
CMD ["catalina.sh", "run"]

Dockerfile.bak

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM tomcat
2+
COPY target/simplewebapp.war /usr/local/tomcat/webapps
3+
EXPOSE 8080
4+
CMD ["catalina.sh", "run"]

0 commit comments

Comments
 (0)