Skip to content

Commit 0b87436

Browse files
committed
Docker Multi-Stage Build.
1 parent a417de4 commit 0b87436

1 file changed

Lines changed: 17 additions & 3 deletions

File tree

Dockerfile

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
1-
FROM ubuntu:latest
2-
LABEL authors="safi-io"
1+
FROM maven:3.9.3-eclipse-temurin-17 AS build
32

4-
ENTRYPOINT ["top", "-b"]
3+
WORKDIR /app
4+
5+
COPY pom.xml .
6+
COPY src ./src
7+
8+
RUN mvn clean package
9+
10+
FROM eclipse-temurin:17-jdk-alpine
11+
12+
WORKDIR /app
13+
14+
COPY --from=build /app/target/mtws-1.0.jar ./mtws.jar
15+
16+
EXPOSE 8888
17+
18+
ENTRYPOINT ["java", "-jar", "mtws.jar"]

0 commit comments

Comments
 (0)