diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..ce3fcede7 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,17 @@ +# Per developer files +build/ +.idea/ +.gradle/ +.kotlin/ + +# Dockerfile related files do not need to be included +Dockerfile +docker-compose.yml +.env + +# Not used in running application +reposilite-site +reposilite-test +reposilite-plugins +.github/ +.codecov.yml diff --git a/Dockerfile b/Dockerfile index 6da75680b..eda4521fc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,15 @@ +# syntax=docker.io/docker/dockerfile:1.7-labs + # Build stage -FROM openjdk:21-slim AS build -COPY . /home/reposilite-build +FROM eclipse-temurin:21-jdk-noble AS build +COPY --exclude=entrypoint.sh . /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 + +# The below line will show an Error in some IDE's, It is valid Dockerfile. +RUN --mount=type=cache,target=/root/.gradle <&2 + printf "\033[1;31mAfter 3.6.0 docker installations with user id of 999 will no longer work.\033[0m\n" 1>&2 + printf "\033[1;31mFor more information see: https://github.com/dzikoysk/reposilite/issues/2288\033[0m\n" 1>&2 + printf "\033[1;31mIF YOU DOWNGRADE PAST THIS POINT \"Hic sunt dracones\"\033[0m\n" 1>&2 + fi + # GH-1634: support custom user and group ids - GROUP_ID="${PGID:-999}" + GROUP_ID="${PGID:-977}" if ! grep -q "^reposilite" /etc/group; then addgroup --gid "$GROUP_ID" reposilite; fi - USER_ID="${PUID:-999}" + USER_ID="${PUID:-977}" if ! grep "^reposilite" /etc/passwd; then adduser --system -uid "$USER_ID" --ingroup reposilite --shell /bin/sh reposilite;