This repository has been archived by the owner on Jul 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
45 lines (35 loc) · 1.53 KB
/
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
# ------------------------------------------------------
# Dockerfile
# ------------------------------------------------------
# authors: Nicolas Pearson
# image: veritas
# tag: <COMMIT HASH>
# how-to: docker build -t veritas:<COMMIT HASH> --build-arg VERSION=<COMMIT HASH> .
# requires: node:16.13-alpine3.12
# ------------------------------------------------------
# BUILDER - Artifacts build for production
FROM node:16.13-alpine3.12 AS builder
WORKDIR /usr/src/app
RUN chown node:node .
USER node
COPY --chown=node:node . .
RUN yarn install --immutable
RUN yarn build
# RUNNER - Production image
FROM node:16.13-alpine3.12
# Set the NODE_ENV to production
ENV NODE_ENV=production
WORKDIR /usr/src/app
USER node
COPY --chown=node:node --from=builder /usr/src/app/.pnp.cjs ./.pnp.cjs
COPY --chown=node:node --from=builder /usr/src/app/.pnp.loader.mjs ./.pnp.loader.mjs
COPY --chown=node:node --from=builder /usr/src/app/.yarn/cache ./.yarn/cache
COPY --chown=node:node --from=builder /usr/src/app/.yarn/plugins ./.yarn/plugins
COPY --chown=node:node --from=builder /usr/src/app/.yarn/releases ./.yarn/releases
COPY --chown=node:node --from=builder /usr/src/app/.yarnrc.yml ./.yarnrc.yml
COPY --chown=node:node --from=builder /usr/src/app/package.json ./package.json
COPY --chown=node:node --from=builder /usr/src/app/yarn.lock ./yarn.lock
COPY --chown=node:node --from=builder /usr/src/app/package.json ./package.json
COPY --chown=node:node --from=builder /usr/src/app/dist ./dist
RUN yarn install --immutable
CMD yarn start