Merge pull request #16 from FilipBl4gojevic/fix/dockerfile-postinstall-scripts

fix(docker): copy scripts/ before npm ci - deploy is currently failing on main
This commit is contained in:
dcejtlin-apex
2026-08-03 14:01:57 +02:00
committed by GitHub

View File

@@ -3,6 +3,11 @@ WORKDIR /app
COPY package*.json ./ COPY package*.json ./
COPY packages/shared/package.json ./packages/shared/ COPY packages/shared/package.json ./packages/shared/
COPY packages/builder/package.json ./packages/builder/ COPY packages/builder/package.json ./packages/builder/
# The root postinstall runs scripts/link-libsodium.mjs, so that script has to be
# present before `npm ci`, not with the later source COPY. It is fail-loud by
# design (the old shell one-liner ended in `|| true` and silently no-opped), so a
# missing script fails the build here rather than shipping a broken image.
COPY scripts/ ./scripts/
RUN npm ci RUN npm ci
COPY packages/ ./packages/ COPY packages/ ./packages/
RUN npm run build RUN npm run build
@@ -12,6 +17,8 @@ WORKDIR /app
COPY package*.json ./ COPY package*.json ./
COPY packages/shared/package.json ./packages/shared/ COPY packages/shared/package.json ./packages/shared/
COPY packages/builder/package.json ./packages/builder/ COPY packages/builder/package.json ./packages/builder/
# Same reason as the builder stage: postinstall needs this before `npm ci`.
COPY scripts/ ./scripts/
RUN npm ci --omit=dev RUN npm ci --omit=dev
COPY --from=builder /app/packages/builder/build/ ./packages/builder/build/ COPY --from=builder /app/packages/builder/build/ ./packages/builder/build/
EXPOSE 3000 EXPOSE 3000