From d4b05b2612623035b54ede040d85bd55e753e480 Mon Sep 17 00:00:00 2001 From: Ben Phelps Date: Wed, 14 Sep 2022 19:04:19 +0300 Subject: [PATCH] experiment with entrypoint for backwards compat --- Dockerfile | 5 +++-- docker-entrypoint.sh | 9 +++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100755 docker-entrypoint.sh diff --git a/Dockerfile b/Dockerfile index 27f9aaa00..ab7e12725 100644 --- a/Dockerfile +++ b/Dockerfile @@ -44,6 +44,8 @@ LABEL org.opencontainers.image.licenses='Apache-2.0' ENV NODE_ENV production WORKDIR /app +ADD docker-entrypoint.sh docker-entrypoint.sh + # Copy files from context (this allows the files to copy before the builder stage is done). COPY --link package.json next.config.js ./ COPY --link /public ./public @@ -58,5 +60,4 @@ EXPOSE $PORT HEALTHCHECK --interval=10s --timeout=3s --start-period=20s \ CMD wget --no-verbose --tries=1 --spider --no-check-certificate http://localhost:$PORT/api/healthcheck || exit 1 -USER $PUID:$PGID -CMD ["node", "server.js"] +ENTRYPOINT ["/app/docker-entrypoint.sh"] diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh new file mode 100755 index 000000000..5603d7e58 --- /dev/null +++ b/docker-entrypoint.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +set -e + +# This is in attempt to preserve the original behavior of the Dockerfile, +# while also supporting the lscr.io /config directory +[ ! -d "/app/config" ] && ln -s /config /app/config + +node server.js