-
-
Notifications
You must be signed in to change notification settings - Fork 185
/
Dockerfile
46 lines (44 loc) · 1.62 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Build stage
FROM openjdk:21-slim AS build
COPY . /home/reposilite-build
WORKDIR /home/reposilite-build
RUN \
rm -rf reposilite-frontend/node_modules
RUN \
apt-get update; apt-get install -y curl
RUN \
export GRADLE_OPTS="-Djdk.lang.Process.launchMechanism=vfork" && \
chmod +x gradlew && \
bash gradlew :reposilite-backend:shadowJar --no-daemon --stacktrace
# Build-time metadata stage
ARG BUILD_DATE
ARG VCS_REF
ARG VERSION
LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.name="Reposilite" \
org.label-schema.description="Lightweight repository management software dedicated for the Maven artifacts" \
org.label-schema.url="https://reposilite.com" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url="https://github.com/dzikoysk/reposilite" \
org.label-schema.vendor="dzikoysk" \
org.label-schema.version=$VERSION \
org.label-schema.schema-version="1.0"
# Run stage
FROM openjdk:21-slim
RUN mkdir -p /app/data && mkdir -p /var/log/reposilite
VOLUME /app/data
WORKDIR /app
COPY --from=build /home/reposilite-build/reposilite-backend/build/libs/reposilite-3*.jar reposilite.jar
COPY --from=build /home/reposilite-build/entrypoint.sh entrypoint.sh
RUN chmod +x /app/entrypoint.sh
RUN apt-get update && apt-get -y install util-linux curl
HEALTHCHECK --interval=30s --timeout=30s --start-period=15s \
--retries=3 CMD [ "sh", "-c", "URL=$(cat /app/data/.local/reposilite.address); echo -n \"curl $URL... \"; \
(\
curl -sf $URL > /dev/null\
) && echo OK || (\
echo Fail && exit 2\
)"]
ENTRYPOINT ["/app/entrypoint.sh"]
CMD []
EXPOSE 8080