1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-28 19:06:12 +01:00
unleash.unleash/Dockerfile
Christopher Kolstad 15726cc8ac
chore: upgrade to yarn v4 (#7230)
![Outdated as of
2020](https://github.com/Unleash/unleash/assets/177402/689a1bcc-441d-4b87-88a6-125e68a17f26)

This has been on our TODO list for a long time.

We're moving to latest released at the time of commit (v4.2.2)
2024-06-07 14:00:19 +02:00

39 lines
722 B
Docker

ARG NODE_VERSION=20.14.0-alpine
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
RUN mkdir -p /unleash/build/frontend && mv /unleash/frontend/build /unleash/build/frontend/build
WORKDIR /unleash/docker
RUN yarn install
FROM node:$NODE_VERSION
ENV NODE_ENV production
ENV TZ UTC
WORKDIR /unleash
COPY --from=builder /unleash/docker /unleash
RUN rm -rf /usr/local/lib/node_modules/npm/
EXPOSE 4242
USER node
CMD ["node", "index.js"]