2024-07-15 19:10:13 +02:00
|
|
|
ARG NODE_VERSION=20.15.0-alpine
|
2022-06-28 16:13:00 +02:00
|
|
|
|
2022-08-30 14:39:28 +02:00
|
|
|
FROM node:$NODE_VERSION as builder
|
2022-06-28 16:13:00 +02:00
|
|
|
|
|
|
|
WORKDIR /unleash
|
|
|
|
|
|
|
|
COPY . /unleash
|
|
|
|
|
2024-06-27 12:52:43 +02:00
|
|
|
RUN corepack enable
|
2022-08-29 15:00:04 +02:00
|
|
|
|
2024-06-27 12:52:43 +02:00
|
|
|
RUN yarn install --immutable && yarn prepare:backend && yarn local:package
|
2022-08-30 14:39:28 +02:00
|
|
|
|
2023-07-20 14:13:44 +02:00
|
|
|
# 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)
|
2024-06-07 15:00:02 +02:00
|
|
|
RUN yarn build:frontend:if-needed
|
2023-07-20 14:13:44 +02:00
|
|
|
|
2023-06-12 09:15:09 +02:00
|
|
|
RUN mkdir -p /unleash/build/frontend && mv /unleash/frontend/build /unleash/build/frontend/build
|
2022-06-28 16:13:00 +02:00
|
|
|
|
|
|
|
WORKDIR /unleash/docker
|
|
|
|
|
2024-06-27 12:52:43 +02:00
|
|
|
RUN yarn workspaces focus -A --production
|
2022-06-28 16:13:00 +02:00
|
|
|
|
|
|
|
FROM node:$NODE_VERSION
|
|
|
|
|
|
|
|
ENV NODE_ENV production
|
|
|
|
|
2023-05-03 09:25:56 +02:00
|
|
|
ENV TZ UTC
|
|
|
|
|
2022-06-28 16:13:00 +02:00
|
|
|
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"]
|