2024-05-23 14:14:09 +02:00
|
|
|
ARG NODE_VERSION=20.13.1-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
|
|
|
|
|
2022-08-29 15:00:04 +02:00
|
|
|
RUN yarn config set network-timeout 300000
|
|
|
|
|
2023-06-12 09:15:09 +02:00
|
|
|
RUN yarn install --frozen-lockfile --ignore-scripts && 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)
|
|
|
|
RUN yarn build:frontend:if-needed
|
|
|
|
|
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
|
|
|
|
|
|
|
|
RUN yarn install --frozen-lockfile --production=true
|
|
|
|
|
|
|
|
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"]
|