forked from SocialGouv/code-du-travail-numerique
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
44 lines (31 loc) · 1.78 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
FROM node:14.16-alpine3.13
# NOTE(douglasduteil): add `curl` in the master image
# `curl` is very useful for later health check tests ;)
RUN apk add --no-cache git=~2 curl=~7
#
WORKDIR /app
#
COPY ./scripts /app/scripts
COPY ./package.json /app/package.json
COPY ./yarn.lock /app/yarn.lock
COPY ./packages/code-du-travail-data/package.json /app/packages/code-du-travail-data/package.json
COPY ./packages/code-du-travail-data/prime-precarite/package.json /app/packages/code-du-travail-data/prime-precarite/package.json
COPY ./packages/code-du-travail-data/simulateurs/package.json /app/packages/code-du-travail-data/simulateurs/package.json
COPY ./packages/code-du-travail-data/tools/package.json /app/packages/code-du-travail-data/tools/package.json
COPY ./packages/react-fiche-service-public/package.json /app/packages/react-fiche-service-public/package.json
COPY ./packages/sources/package.json /app/packages/sources/package.json
COPY ./packages/slugify/package.json /app/packages/slugify/package.json
# PERF(douglasduteil): put packages that are more likely to change in order here
# By order of "more likely to change" the frontend, the api, etc... are changing
# more often than the dataset.
# Putting them after will optimise the native docker build cache of the image
COPY ./packages/react-ui/package.json /app/packages/react-ui/package.json
COPY ./packages/code-du-travail-api/package.json /app/packages/code-du-travail-api/package.json
COPY ./packages/code-du-travail-frontend/package.json /app/packages/code-du-travail-frontend/package.json
COPY ./packages/code-du-travail-modeles/package.json /app/packages/code-du-travail-modeles/package.json
RUN yarn --frozen-lockfile && yarn cache clean
# fake CI env
ENV CI=true
COPY ./lerna.json /app/lerna.json
COPY ./packages /app/packages
RUN yarn build