2023-04-18 10:35:32 +02:00
|
|
|
ARG NODE_VERSION=18-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-06-12 09:15:09 +02:00
|
|
|
# frontend/build should already exist (it needs to be built in the local filesystem
|
|
|
|
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"]
|