-
Notifications
You must be signed in to change notification settings - Fork 77
/
Copy pathDockerfile-frontend
41 lines (30 loc) · 920 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
ARG buildImage=node:20-buster-slim
FROM $buildImage AS adminbuild
RUN apt update && apt install -y git
WORKDIR /code
COPY rcongui/ .
RUN npm ci
ENV REACT_APP_API_URL=/api/
COPY .git/ .git/
RUN git describe --tags > /code/tag_version && rm -rf .git
RUN npx browserslist@latest --update-db
RUN npm run build
RUN mv /code/dist /www
FROM $buildImage AS publicbuild
WORKDIR /code_public
COPY rcongui_public/ .
RUN npm ci
RUN npm run build
RUN mv /code_public/dist /www_public
FROM nginx:mainline-alpine
RUN apk add --no-cache openssl
COPY rcongui/nginx.conf /etc/nginx/conf.d/default.conf
WORKDIR /var/www
RUN mkdir /var/www_public/
COPY --from=publicbuild /www_public /var/www_public/
COPY --from=adminbuild /www /var/www/
COPY --from=adminbuild /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" ]