Skip to content

Commit 83e355e

Browse files
committed
feat: docekrfile prod
1 parent 969baec commit 83e355e

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM maven:3.8.5-openjdk-17 as BUILDER
2+
3+
WORKDIR /usr/src/app
4+
5+
COPY ./pom.xml ./pom.xml
6+
COPY ./src ./src
7+
8+
RUN --mount=type=cache,target=/root/.m2 mvn package -DskipTests
9+
10+
FROM openjdk:17-alpine
11+
12+
ENV SERVER_PORT=80
13+
14+
WORKDIR /usr/src/app
15+
16+
COPY --from=BUILDER /usr/src/app/target/api*.jar ./api.jar
17+
18+
EXPOSE ${SERVER_PORT}
19+
20+
CMD [ "java", "-jar", "api.jar" ]

0 commit comments

Comments
 (0)