Skip to content

Commit

Permalink
move compmode to entrypoint for runtime evaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
Alfagun74 committed Jul 30, 2023
1 parent 2e5392a commit fc2671d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#!/bin/sh
set -e

if [[ ! -z "$SERVER_COMPABILITY_MODE" ]] ; then
echo "Force installing [email protected] to ensure compability with older CPUs"
pnpm install [email protected]
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
Expand Down

0 comments on commit fc2671d

Please sign in to comment.