-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathDockerfile.frontend
71 lines (42 loc) · 1.5 KB
/
Dockerfile.frontend
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
FROM node:18-alpine as build
RUN apk --no-cache add --update git
WORKDIR /usr/main/
RUN yarn set version 2 --only-if-needed
ENV GENERATE_SOURCEMAP false
ARG VITE_ENV
ENV VITE_ENV $VITE_ENV
ARG VITE_BACKEND_URL
ENV VITE_BACKEND_URL $VITE_BACKEND_URL
ARG VITE_API_URL
ENV VITE_API_URL $VITE_API_URL
ARG VITE_API_PORT
ENV VITE_API_PORT $VITE_API_PORT
ARG VITE_TOOLKIT_URL
ENV VITE_TOOLKIT_URL $VITE_TOOLKIT_URL
ARG VITE_USE_SSL
ENV VITE_USE_SSL $VITE_USE_SSL
ARG VITE_GA_TRACKING_ID
ENV VITE_GA_TRACKING_ID $VITE_GA_TRACKING_ID
ARG VITE_ZK_ENABLED
ENV VITE_ZK_ENABLED $VITE_ZK_ENABLED
COPY .yarnrc.yml ./.yarnrc.yml
COPY yarn.lock ./yarn.lock
COPY .yarn/ ./.yarn/
COPY package.json ./package.json
COPY frontend/public/ ./frontend/public/
COPY frontend/src/ ./frontend/src/
COPY frontend/.eslintignore ./frontend/.eslintignore
COPY frontend/.eslintrc.json ./frontend/.eslintrc.json
COPY frontend/custom.d.ts ./frontend/custom.d.ts
COPY frontend/index.html ./frontend/index.html
COPY frontend/package.json ./frontend/package.json
COPY frontend/tsconfig.json ./frontend/tsconfig.json
COPY frontend/tsconfig.node.json ./frontend/tsconfig.node.json
COPY frontend/vite.config.ts ./frontend/vite.config.ts
RUN yarn install --silent
RUN NODE_OPTIONS='--max-old-space-size=4096' yarn build
FROM nginx:1.21-alpine as run
RUN sed -i '/location \//a try_files $uri $uri/ /index.html;' /etc/nginx/conf.d/default.conf
COPY --from=build /usr/main/frontend/dist/ /usr/share/nginx/html/
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]