From 586e944d6aa966ac2d7b9807c1246e9b9860503a Mon Sep 17 00:00:00 2001 From: "Patrik J. Braun" Date: Mon, 7 Sep 2020 00:21:39 +0200 Subject: [PATCH] Updating entrypoint to exec form. This also removes support to set config file path from ENV variable. (It was introduced in #130). Should fix: #136 --- docker/alpine/Dockerfile.build | 12 +++++------- docker/debian-stretch/Dockerfile.build | 5 +++-- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/docker/alpine/Dockerfile.build b/docker/alpine/Dockerfile.build index b4de26a1..454561ab 100644 --- a/docker/alpine/Dockerfile.build +++ b/docker/alpine/Dockerfile.build @@ -17,7 +17,6 @@ RUN mkdir -p /app/data/config && \ FROM node:12-alpine3.11 as main WORKDIR /app ENV NODE_ENV=production \ - CONFIG_FILE=/app/data/config/config.json \ # overrides only the default value of the settings (the actualy value can be overwritten through config.json) default-Server-Database-dbFolder=/app/data/db \ default-Server-Media-folder=/app/data/images \ @@ -25,11 +24,6 @@ ENV NODE_ENV=production \ # flagging dockerized environemnt PI_DOCKER=true -# after a extensive job (like video converting), pigallery calls gc, to clean up everthing as fast as possible -# This trick is needed as entrypoint in exec form does not support ENV variables -# and in shell form ENV variables were not properly passed to pigallry2 -RUN echo "#!/usr/bin/env node ./src/backend/index --expose-gc --config-path=${CONFIG_FILE}" > ./entrypoint.sh && \ - chmod +x ./entrypoint.sh EXPOSE 80 RUN apk add --update-cache --repository https://alpine.global.ssl.fastly.net/alpine/v3.11/community/ \ @@ -40,4 +34,8 @@ HEALTHCHECK --interval=40s --timeout=30s --retries=3 --start-period=60s \ CMD wget --quiet --tries=1 --no-check-certificate --spider \ http://localhost:80/heartbeat || exit 1 -ENTRYPOINT ["./entrypoint.sh"] + +# after a extensive job (like video converting), pigallery calls gc, to clean up everthing as fast as possible +# Exec form entrypoint is need otherwise (using shell form) ENV variables are not properly passed down to the app +ENTRYPOINT ["node", "./src/backend/index", "--expose-gc", "--config-path=/app/data/config/config.json"] + diff --git a/docker/debian-stretch/Dockerfile.build b/docker/debian-stretch/Dockerfile.build index a9ad16a4..e06da8ac 100644 --- a/docker/debian-stretch/Dockerfile.build +++ b/docker/debian-stretch/Dockerfile.build @@ -15,7 +15,6 @@ RUN mkdir -p /app/data/config && \ FROM node:12-stretch-slim as main WORKDIR /app ENV NODE_ENV=production \ - CONFIG_FILE=/app/data/config/config.json \ # overrides only the default value of the settings (the actualy value can be overwritten through config.json) default-Server-Database-dbFolder=/app/data/db \ default-Server-Media-folder=/app/data/images \ @@ -37,5 +36,7 @@ HEALTHCHECK --interval=40s --timeout=30s --retries=3 --start-period=60s \ CMD wget --quiet --tries=1 --no-check-certificate --spider \ http://localhost:80/heartbeat || exit 1 -ENTRYPOINT node ./src/backend/index --expose-gc --config-path=${CONFIG_FILE} +# after a extensive job (like video converting), pigallery calls gc, to clean up everthing as fast as possible +# Exec form entrypoint is need otherwise (using shell form) ENV variables are not properly passed down to the app +ENTRYPOINT ["node", "./src/backend/index", "--expose-gc", "--config-path=/app/data/config/config.json"]