-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile.all
43 lines (27 loc) · 1020 Bytes
/
Dockerfile.all
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
FROM node:16.15 as builder
RUN npm install -g [email protected]
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml /app/
COPY shared/package.json /app/shared/
COPY libs/react-design-system/package.json /app/libs/react-design-system/
COPY libs/html-templates/package.json /app/libs/html-templates/
COPY front/package.json /app/front/
COPY back/package.json /app/back/
WORKDIR /app
RUN pnpm install --frozen-lockfile --ignore-scripts
COPY ./shared/ /app/shared
COPY ./libs/react-design-system/ /app/libs/react-design-system
COPY ./libs/html-templates /app/libs/html-templates
# back only
FROM builder AS back
COPY ./back/ /app/back
RUN mkdir -p /app/storage/tmp
WORKDIR /app/back
CMD pnpm db:up && pnpm start-prod
# front only
FROM builder as front
COPY ./front/ /app/front
WORKDIR /app/front
# Necessary to use react-dsrfr, but copy-dsfr-to-public needs to have vite.config to process correctly.
RUN pnpm postinstall
RUN pnpm build
CMD pnpm setup-env-vars dist/env-config.js && npm run serve -- --host 0.0.0.0