-
Notifications
You must be signed in to change notification settings - Fork 24
/
Dockerfile
36 lines (32 loc) · 1.25 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
FROM node:22-slim AS base
RUN corepack enable
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/email/package.json,target=packages/email/package.json \
--mount=type=bind,source=packages/core/package.json,target=packages/core/package.json \
--mount=type=cache,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/email/package.json,target=packages/email/package.json \
--mount=type=bind,source=packages/core/package.json,target=packages/core/package.json \
--mount=type=cache,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" ]