-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
64 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,42 @@ | ||
# The MIT License (MIT) Copyright (c) 2022 artipie.com | ||
# https://github.com/artipie/front/LICENSE.txt | ||
|
||
FROM openjdk:21-oracle | ||
ARG JAR_FILE | ||
FROM openjdk:21-slim-bookworm as build | ||
|
||
ENV JVM_OPTS="" | ||
|
||
LABEL description="Artipie front service" | ||
LABEL maintainer="[email protected]" | ||
|
||
RUN groupadd -r -g 2020 artipie && \ | ||
adduser -M -r -g artipie -u 2021 -s /sbin/nologin artipie && \ | ||
mkdir -p /etc/artipie /usr/lib/web-service /var/artipie && \ | ||
# may optimize but require DOCKER_BUILDKIT=1 | ||
# RUN --mount=target=/var/lib/apt/lists,type=cache \ | ||
# --mount=target=/var/cache/apt,type=cache \ | ||
# --mount=target=/root/.m2,type=cache | ||
|
||
RUN apt-get update | ||
|
||
RUN apt-get install -y --no-install-recommends \ | ||
maven | ||
|
||
# RUN useradd -ms /sbin/nologin artipie -g artipie -u 2021 | ||
COPY . /usr/local/src | ||
WORKDIR /usr/local/src | ||
|
||
RUN mvn clean install -Pqulice | ||
RUN mvn dependency:copy-dependencies -DoutputDirectory=target/dependencies/ | ||
|
||
FROM openjdk:21-oracle as run | ||
|
||
RUN groupadd -r -g 2020 artipie | ||
RUN adduser -M -r -g artipie -u 2021 -s /sbin/nologin artipie | ||
RUN mkdir -p /etc/artipie /usr/lib/web-service /var/artipie && \ | ||
chown artipie:artipie -R /etc/artipie /usr/lib/web-service /var/artipie | ||
USER 2021:2020 | ||
|
||
COPY target/dependency /usr/lib/web-service/lib | ||
COPY target/${JAR_FILE} /usr/lib/web-service/app.jar | ||
USER artipie:artipie | ||
ARG JAR_FILE=front-*-SNAPSHOT.jar | ||
|
||
COPY --from=build /usr/local/src/target/dependencies/* /usr/lib/web-service/lib/ | ||
COPY --from=build /usr/local/src/target/${JAR_FILE} /usr/lib/web-service/app.jar | ||
|
||
WORKDIR /var/web-service | ||
HEALTHCHECK --interval=10s --timeout=3s \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters