1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-05-17 01:17:29 +02:00
unleash.unleash/Dockerfile
Christopher Kolstad 4b3c808169
Task/bump docker base image (#9716)
As reported in #9710 . This PR updates to 20.19.0-alpine3.21 which
according to docker's own scan now longer is affected by the CVE
2025-04-08 10:56:50 +02:00

41 lines
848 B
Docker

ARG NODE_VERSION=20.19.0-alpine3.21
FROM node:$NODE_VERSION AS builder
WORKDIR /unleash
COPY . /unleash
RUN corepack enable
RUN yarn install --immutable && yarn prepare:backend && yarn 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 yarn build:frontend:if-needed
RUN mkdir -p /unleash/build/frontend && mv /unleash/frontend/build /unleash/build/frontend/build
RUN yarn workspaces focus -A --production
FROM node:$NODE_VERSION
ENV NODE_ENV=production
ENV TZ=UTC
WORKDIR /unleash
COPY --from=builder /unleash/build /unleash/build
COPY --from=builder /unleash/node_modules /unleash/node_modules
COPY ./docker/index.js /unleash/index.js
RUN rm -rf /usr/local/lib/node_modules/npm/
EXPOSE 4242
USER node
CMD ["node", "index.js"]