-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathDockerfile
More file actions
56 lines (52 loc) · 3.37 KB
/
Dockerfile
File metadata and controls
56 lines (52 loc) · 3.37 KB
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
46
47
48
49
50
51
52
53
54
55
56
FROM node:22-slim AS base
ENV NPM_CONFIG_UPDATE_NOTIFIER=false
WORKDIR /app
FROM base AS prod-deps
RUN --mount=type=bind,source=package.json,target=package.json \
--mount=type=bind,source=package-lock.json,target=package-lock.json \
--mount=type=bind,source=packages/annuaire_entreprises/package.json,target=packages/annuaire_entreprises/package.json \
--mount=type=bind,source=packages/core/package.json,target=packages/core/package.json \
--mount=type=bind,source=packages/crisp/package.json,target=packages/crisp/package.json \
--mount=type=bind,source=packages/database/package.json,target=packages/database/package.json \
--mount=type=bind,source=packages/debounce/package.json,target=packages/debounce/package.json \
--mount=type=bind,source=packages/devtools/typescript/package.json,target=packages/devtools/typescript/package.json \
--mount=type=bind,source=packages/email/package.json,target=packages/email/package.json \
--mount=type=bind,source=packages/entreprise/package.json,target=packages/entreprise/package.json \
--mount=type=bind,source=packages/identite/package.json,target=packages/identite/package.json \
--mount=type=bind,source=packages/insee/package.json,target=packages/insee/package.json \
--mount=type=bind,source=packages/registre_national_entreprises/package.json,target=packages/registre_national_entreprises/package.json \
--mount=type=bind,source=packages/testing/package.json,target=packages/testing/package.json \
--mount=type=cache,sharing=locked,target=/root/.npm \
npm ci --omit=dev
FROM base AS build
ENV CYPRESS_INSTALL_BINARY=0
RUN --mount=type=bind,source=package.json,target=package.json \
--mount=type=bind,source=package-lock.json,target=package-lock.json \
--mount=type=bind,source=packages/annuaire_entreprises/package.json,target=packages/annuaire_entreprises/package.json \
--mount=type=bind,source=packages/core/package.json,target=packages/core/package.json \
--mount=type=bind,source=packages/crisp/package.json,target=packages/crisp/package.json \
--mount=type=bind,source=packages/database/package.json,target=packages/database/package.json \
--mount=type=bind,source=packages/debounce/package.json,target=packages/debounce/package.json \
--mount=type=bind,source=packages/devtools/typescript/package.json,target=packages/devtools/typescript/package.json \
--mount=type=bind,source=packages/email/package.json,target=packages/email/package.json \
--mount=type=bind,source=packages/entreprise/package.json,target=packages/entreprise/package.json \
--mount=type=bind,source=packages/identite/package.json,target=packages/identite/package.json \
--mount=type=bind,source=packages/insee/package.json,target=packages/insee/package.json \
--mount=type=bind,source=packages/registre_national_entreprises/package.json,target=packages/registre_national_entreprises/package.json \
--mount=type=bind,source=packages/testing/package.json,target=packages/testing/package.json \
--mount=type=cache,sharing=locked,target=/root/.npm \
npm ci
COPY tsconfig.json vite.config.mjs ./
COPY assets/ ./assets/
COPY public/ ./public/
COPY src/ ./src/
COPY packages/ ./packages/
COPY package*.json ./
RUN npx run-s build:*
FROM base
COPY package.json ./
COPY --from=prod-deps /app/node_modules /app/node_modules
COPY --from=build /app/dist /app/dist
COPY --from=build /app/src /app/src
COPY --from=build /app/packages /app/packages
CMD [ "npm", "start" ]