forked from leitop2k/unleash4.15.4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
41 lines (21 loc) · 757 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
ARG NODE_VERSION=16-alpine
FROM --platform=$BUILDPLATFORM node:$NODE_VERSION as frontend_builder
WORKDIR /frontend
COPY ./frontend /frontend
RUN yarn install --frozen-lockfile
FROM node:$NODE_VERSION as builder
WORKDIR /unleash
COPY . /unleash
RUN yarn config set network-timeout 300000
RUN yarn install --frozen-lockfile --ignore-scripts && yarn run build && yarn run local:package
COPY --from=frontend_builder /frontend/build /unleash/build/frontend/build
WORKDIR /unleash/docker
RUN yarn install --frozen-lockfile --production=true
FROM node:$NODE_VERSION
ENV NODE_ENV production
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"]