forked from dodona-edu/dolos
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.web
More file actions
30 lines (19 loc) · 779 Bytes
/
Dockerfile.web
File metadata and controls
30 lines (19 loc) · 779 Bytes
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
FROM node:22.17.1-alpine3.22
WORKDIR /repo/
RUN apk add --no-cache curl
ADD package-lock.json package.json tsconfig.global.json /repo/
ADD core/ /repo/core
ADD web/index.d.ts web/index.js web/index.html web/package.json web/tsconfig.json web/vite.config.ts web/tsconfig.node.json /repo/web/
ADD web/src /repo/web/src
ADD web/public /repo/web/public
RUN npm install
RUN npm run build --workspace core
ENV VITE_HOST=0.0.0.0
ENV VITE_PORT=8080
ENV VITE_MODE=server
ENV DEFAULT_VITE_API_URL=http://localhost:3000
EXPOSE 8080/tcp
WORKDIR /repo/web
RUN VITE_API_URL="$DEFAULT_VITE_API_URL" npm run build
SHELL ["/bin/sh", "-c"]
CMD (test "$VITE_API_URL" == "$DEFAULT_VITE_API_URL" || npm run build) && npm run preview -- --host "$VITE_HOST" --port "$VITE_PORT" --strictPort