From 481ab9a01bdbe44ca64e5b065f2b81e41bee3ea0 Mon Sep 17 00:00:00 2001 From: Glenn Toms Date: Fri, 12 Jun 2020 17:50:07 +0100 Subject: [PATCH] Added ENV PORT options and EXPORT PORT --- Dockerfile | 7 ++++++- Dockerfile.arm32v7 | 7 ++++++- Dockerfile.arm64v8 | 7 ++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 205d759..73519e0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,12 +16,17 @@ ENV USER darkhttpd ENV GROUP darkhttpd ENV GID 911 ENV UID 911 +ENV PORT 8080 RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} && \ apk add -U darkhttpd +RUN echo "darkhttpd /www/ --no-listing --port $PORT" > /entrypoint.sh +RUN set -ex chown ${USER}:${GROUP} /entrypoint.sh + USER ${USER} COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist /www/ -ENTRYPOINT ["darkhttpd","/www/", "--no-listing"] \ No newline at end of file +EXPOSE ${PORT} +ENTRYPOINT ["/bin/sh", "/entrypoint.sh"] diff --git a/Dockerfile.arm32v7 b/Dockerfile.arm32v7 index 7664f66..952ecb7 100644 --- a/Dockerfile.arm32v7 +++ b/Dockerfile.arm32v7 @@ -25,13 +25,18 @@ ENV USER darkhttpd ENV GROUP darkhttpd ENV GID 911 ENV UID 911 +ENV PORT 8080 RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} && \ apk add -U darkhttpd && \ rm /usr/bin/qemu-arm-static +RUN echo "darkhttpd /www/ --no-listing --port $PORT" > /entrypoint.sh +RUN set -ex chown ${USER}:${GROUP} /entrypoint.sh + USER ${USER} COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist /www/ -ENTRYPOINT ["darkhttpd","/www/","--no-listing"] +EXPOSE ${PORT} +ENTRYPOINT ["/bin/sh", "/entrypoint.sh"] diff --git a/Dockerfile.arm64v8 b/Dockerfile.arm64v8 index 0175341..d9c8aab 100644 --- a/Dockerfile.arm64v8 +++ b/Dockerfile.arm64v8 @@ -25,13 +25,18 @@ ENV USER darkhttpd ENV GROUP darkhttpd ENV GID 911 ENV UID 911 +ENV PORT 8080 RUN addgroup -S ${GROUP} -g ${GID} && adduser -D -S -u ${UID} ${USER} ${GROUP} && \ apk add -U darkhttpd && \ rm /usr/bin/qemu-aarch64-static +RUN echo "darkhttpd /www/ --no-listing --port $PORT" > /entrypoint.sh +RUN set -ex chown ${USER}:${GROUP} /entrypoint.sh + USER ${USER} COPY --from=build-stage --chown=${USER}:${GROUP} /app/dist /www/ -ENTRYPOINT ["darkhttpd","/www/","--no-listing"] +EXPOSE ${PORT} +ENTRYPOINT ["/bin/sh", "/entrypoint.sh"]