From fc2671d7631700fffdf79fdec843869bcda01a38 Mon Sep 17 00:00:00 2001 From: Alper Alkan Date: Sun, 30 Jul 2023 23:48:35 +0200 Subject: [PATCH] move compmode to entrypoint for runtime evaluation --- Dockerfile | 3 +-- entrypoint.sh | 5 +++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 32f2b878..3f5df10b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,11 +26,10 @@ RUN pnpm run build FROM base AS prod-deps COPY package.json pnpm-lock.yaml ./ RUN pnpm install --prod --frozen-lockfile -# Enables compability mode for older CPUs -RUN old-cpu-compability-mode.sh FROM base AS release ENV NODE_ENV=production +COPY package.json pnpm-lock.yaml ./ COPY --from=build /app/dist ./dist COPY --from=prod-deps /app/node_modules ./node_modules # Chown /app to the original node user (1000) diff --git a/entrypoint.sh b/entrypoint.sh index 2a631700..3c1c0621 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,6 +1,11 @@ #!/bin/sh set -e +if [[ ! -z "$SERVER_COMPABILITY_MODE" ]] ; then + echo "Force installing sharp@0.27.2 to ensure compability with older CPUs" + pnpm install sharp@0.27.2 +fi + # If running as root, it means the --user directive for Docker CLI/Compose was not used # Use then the PUID env if [ "$(id -u)" = '0' ]; then