-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathDockerfile.web
More file actions
36 lines (30 loc) · 1.03 KB
/
Dockerfile.web
File metadata and controls
36 lines (30 loc) · 1.03 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
# SPDX-FileCopyrightText: 2021-2025 DINUM <floss@numerique.gouv.fr>
# SPDX-FileCopyrightText: 2024-2025 Université Grenoble Alpes
# SPDX-License-Identifier: MIT
# build step
FROM node:24-alpine as build
RUN corepack enable && corepack prepare pnpm@10.32.1 --activate
WORKDIR /app
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
COPY api/package.json api/
COPY web/package.json web/
COPY web/public/ web/public/
COPY web/index.html web/
RUN pnpm install --frozen-lockfile --ignore-scripts
RUN cd web && pnpm postinstall
COPY turbo.json ./
COPY api/ api/
COPY web/src/ web/src/
COPY web/vite.config.ts web/tsconfig.json web/.env.declaration web/
WORKDIR /app
RUN pnpm build
WORKDIR /app
COPY web/nginx.conf web/
## ----- web only ------
# to build only front run
# docker build . --target web --tag my-web-tag
FROM nginx:stable-alpine as web
COPY --from=build /app/web/nginx.conf /etc/nginx/conf.d/default.conf
WORKDIR /usr/share/nginx
COPY --from=build /app/web/build ./html
ENTRYPOINT sh -c "./html/vite-envs.sh && nginx -g 'daemon off;'"