diff --git a/connector/Dockerfile b/connector/Dockerfile index e9bc1a5b3..ec48ac048 100644 --- a/connector/Dockerfile +++ b/connector/Dockerfile @@ -8,6 +8,16 @@ RUN --mount=type=cache,target=/home/gradle/.gradle/caches gradle build --no-daem FROM eclipse-temurin:17-jre-alpine +# Install curl for healthcheck, bash for entrypoint +RUN apk add --no-cache curl bash +SHELL ["/bin/bash", "-c"] + +# Create empty properties file to avoid errors when loading properties +RUN touch /emtpy-properties-file.properties + +RUN adduser -D -H -s /sbin/nologin edc +USER edc:edc + ARG EDC_LAST_COMMIT_INFO_ARG="The docker container was built outside of github actions and you didn't provide the build arg EDC_LAST_COMMIT_INFO_ARG, so there's no last commit info." ENV EDC_LAST_COMMIT_INFO=$EDC_LAST_COMMIT_INFO_ARG @@ -17,12 +27,6 @@ ENV EDC_BUILD_DATE=$EDC_BUILD_DATE_ARG # Optional JVM arguments, such as memory settings ARG JVM_ARGS="" -# Install curl for healthcheck -RUN apk add --no-cache curl - -# Create empty properties file to avoid errors when loading properties -RUN touch /emtpy-properties-file.properties - WORKDIR /app COPY --from=build /home/gradle/project/connector/build/libs/app.jar /app @@ -40,4 +44,4 @@ COPY ./connector/.env /app/.env # Replaces ENV Var statements so they don't overwrite existing ENV Vars RUN sed -ri 's/^\s*(\S+)=(.*)$/\1=${\1:-"\2"}/' .env -ENTRYPOINT bash -c 'set -a && source /app/.env && set +a && exec java -Djava.util.logging.config.file=/app/logging.properties $JVM_ARGS -jar app.jar' +ENTRYPOINT set -a && source /app/.env && set +a && exec java -Djava.util.logging.config.file=/app/logging.properties $JVM_ARGS -jar app.jar