Skip to content

Commit

Permalink
fix: Fix arm64 build of sodium-native via node-gyp
Browse files Browse the repository at this point in the history
  • Loading branch information
meyfa committed Dec 1, 2024
1 parent 3f61d88 commit 7804282
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,31 @@ WORKDIR /app
COPY package*.json ./
COPY backend/package*.json ./backend/
COPY frontend/package*.json ./frontend/
RUN npm ci
# https://github.com/nodejs/docker-node/blob/main/docs/BestPractices.md#node-gyp-alpine
RUN apk add --no-cache --virtual .gyp python3 py-setuptools make g++ \
&& npm ci \
&& apk del .gyp

# copy in app code and build it
COPY . .
RUN npm run build


# -- execution --
FROM node:20.18.1-alpine
WORKDIR /app

RUN apk add --no-cache tini

# install PRODUCTION dependencies
# install production dependencies
COPY package*.json ./
COPY backend/package*.json ./backend/
COPY frontend/package*.json ./frontend/
RUN npm ci --omit=dev --workspace=backend --include-workspace-root && npm cache clean --force

# https://github.com/nodejs/docker-node/blob/main/docs/BestPractices.md#node-gyp-alpine
RUN apk add --no-cache --virtual .gyp python3 py-setuptools make g++ \
&& npm ci --omit=dev --workspace=backend --include-workspace-root \
&& npm cache clean --force \
&& apk del .gyp

# add the already compiled code and the default config
# (custom config must be set via volume)
Expand Down

0 comments on commit 7804282

Please sign in to comment.