Skip to content

Commit f1d9983

Browse files
committed
Docker as nonroot, fix status vars
1 parent 35e1b06 commit f1d9983

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

Dockerfile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,16 @@ RUN mvn package
1010

1111

1212
FROM gcr.io/distroless/java21-debian12
13+
ARG COMMIT="(not set)"
14+
ARG LASTMOD="(not set)"
15+
ENV COMMIT=$COMMIT
16+
ENV LASTMOD=$LASTMOD
17+
18+
WORKDIR /app
1319

1420
COPY --from=builder /app/target/regexplanet-1.0.jar /app/regexplanet-1.0.jar
1521

16-
WORKDIR /app
22+
USER nonroot
23+
EXPOSE 4000
24+
ENV PORT=4000
1725
CMD ["regexplanet-1.0.jar"]

docker-run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ docker build \
1515
docker run \
1616
--publish 4000:4000 \
1717
--expose 4000 \
18-
--env SERVER_PORT='4000' \
18+
--env PORT='4000' \
1919
regexplanet-java

0 commit comments

Comments
 (0)