-
Notifications
You must be signed in to change notification settings - Fork 72
/
Dockerfile-frontend
45 lines (31 loc) · 919 Bytes
/
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
FROM node:20-buster-slim as build
RUN apt update && apt install -y git
WORKDIR /code
RUN mkdir /pw
COPY rcongui/package.json package.json
COPY rcongui/package-lock.json package-lock.json
RUN npm ci
ENV REACT_APP_API_URL /api/
COPY rcongui/ .
COPY .git/ .git/
RUN git describe --tags > /code/tag_version
RUN npx browserslist@latest --update-db
# Normal build
RUN npm run build
RUN mv /code/dist /www
# Public build
ENV REACT_APP_PUBLIC_BUILD true
RUN npm run build
RUN mv /code/dist /www_public
FROM nginx:mainline-alpine
RUN apk add openssl
COPY rcongui/nginx.conf /etc/nginx/conf.d/default.conf
WORKDIR /var/www
RUN mkdir /var/www_public/
COPY --from=build /www_public /var/www_public/
COPY --from=build /www /var/www/
COPY --from=build /code/tag_version /code/tag_version
VOLUME /certs
COPY rcongui/entrypoint.sh /code/entrypoint.sh
RUN chmod +x /code/entrypoint.sh
ENTRYPOINT [ "/code/entrypoint.sh" ]