mirror of
https://github.com/Unleash/unleash.git
synced 2026-10-26 21:58:10 +00:00
015c3bc3ca
Use newer node
Advisory: https://emudhra.we-have-a-problem.com/
(cherry picked from commit 48b449a6a4)
43 lines
891 B
Docker
43 lines
891 B
Docker
ARG NODE_VERSION=22.23.4-alpine3.23
|
|
|
|
FROM node:$NODE_VERSION AS builder
|
|
|
|
RUN apk add --no-cache grep
|
|
|
|
WORKDIR /unleash
|
|
|
|
COPY . /unleash
|
|
|
|
RUN corepack enable
|
|
|
|
RUN pnpm install --frozen-lockfile --ignore-scripts && pnpm prepare:backend && pnpm local:package
|
|
|
|
# frontend/build should already exist (it needs to be built in the local filesystem but in case of a fresh build we'll build it here)
|
|
RUN pnpm build:frontend:if-needed
|
|
|
|
RUN mkdir -p /unleash/build/frontend && mv /unleash/frontend/build /unleash/build/frontend/build
|
|
|
|
RUN CI=true pnpm prune --prod --ignore-scripts
|
|
|
|
FROM node:$NODE_VERSION
|
|
|
|
ENV NODE_ENV=production
|
|
|
|
ENV TZ=UTC
|
|
|
|
WORKDIR /unleash
|
|
|
|
COPY --from=builder /unleash/build /unleash/
|
|
|
|
COPY --from=builder /unleash/node_modules /unleash/node_modules
|
|
|
|
RUN rm -rf /usr/local/lib/node_modules/npm/
|
|
|
|
RUN apk upgrade --no-cache
|
|
|
|
EXPOSE 4242
|
|
|
|
USER node
|
|
|
|
CMD ["node", "dist/server.js"]
|