Skip to content

Commit c64ea9d

Browse files
Optimize position-service Dockerfile (#259)
Signed-off-by: Mathieu Benoit <mathieu-benoit@hotmail.fr>
1 parent f126407 commit c64ea9d

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

position-service/Dockerfile

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,10 @@
1-
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/java/.devcontainer/base.Dockerfile
2-
3-
# [Choice] Java version (use -bullseye variants on local arm64/Apple Silicon): 11, 17, 11-bullseye, 17-bullseye, 11-buster, 17-buster
4-
ARG VARIANT="21"
5-
FROM mcr.microsoft.com/vscode/devcontainers/java:1-${VARIANT} AS build-stage
6-
7-
# Copy code
8-
WORKDIR /position-service
1+
FROM --platform=$BUILDPLATFORM eclipse-temurin:21-jdk AS build-stage
2+
WORKDIR /app
93
COPY . .
10-
11-
# Build code
124
RUN ./gradlew build
135

14-
FROM mcr.microsoft.com/openjdk/jdk:${VARIANT}-ubuntu
6+
FROM eclipse-temurin:21-jre-alpine
157
RUN mkdir /app
16-
COPY --from=build-stage /position-service/build/libs/*.jar /app/position-service.jar
8+
COPY --from=build-stage /app/build/libs/*.jar /app/position-service.jar
179
EXPOSE 18090
18-
# ENTRYPOINT ./gradlew bootRun
1910
ENTRYPOINT ["java","-jar","/app/position-service.jar"]

0 commit comments

Comments
 (0)