forked from dzikoysk/reposilite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
42 lines (40 loc) · 1.53 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
# Build stage
FROM openjdk:19-slim AS build
COPY . /home/reposilite-build
WORKDIR /home/reposilite-build
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:19-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 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 ["/bin/sh", "entrypoint.sh"]
CMD []