-
Notifications
You must be signed in to change notification settings - Fork 36
/
Dockerfile
45 lines (26 loc) · 930 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
42
43
44
45
FROM digichanges/nexp:1.4 AS dev
WORKDIR /home/node
USER node
COPY --chown=node:node ["package.json", "pnpm-lock.yaml", ".husky", ".huskyrc", "/home/node/"]
RUN pnpm install
COPY --chown=node:node [".", "/home/node/"]
EXPOSE 8089
ENTRYPOINT ["dumb-init", "pnpm","dev"]
FROM dev AS build
RUN pnpm build
RUN rm -rf node_modules
FROM build AS prerelease
USER node
RUN pnpm install --production --ignore-scripts \
&& cd node_modules/bcrypt \
&& npm rebuild bcrypt --build-from-source
FROM digichanges/nexp:1.4 AS prod
ENV NODE_ENV production
WORKDIR /home/node
USER node
# Copy js files and change ownership to user node
COPY --from=prerelease /home/node/node_modules/ ./node_modules/
COPY --from=prerelease /home/node/dist/ ./dist/
COPY --from=prerelease /home/node/package.json/ ./package.json
COPY --from=prerelease /home/node/pnpm-lock.yaml/ ./pnpm-lock.yaml
ENTRYPOINT ["dumb-init", "pnpm", "start"]