-
Notifications
You must be signed in to change notification settings - Fork 13
/
Dockerfile.saas
53 lines (37 loc) · 1.49 KB
/
Dockerfile.saas
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
FROM node:18-alpine3.17 AS build
# LABELS
LABEL \
org.opencontainers.image.authors="Netmaker Inc." \
org.opencontainers.image.vendor="ReactJS" \
org.opencontainers.image.url="local" \
org.opencontainers.image.source="https://dockerhub.com/" \
org.opencontainers.image.version="$VERSION" \
org.opencontainers.image.revision="$REVISION" \
vendor="ReactJS" \
name="Netmaker UI" \
version="$VERSION-$REVISION" \
summary="The frontend of Netmaker. Netmaker builds fast, secure virtual networks." \
description="This image contains the Netmaker frontend running with ReactJS."
WORKDIR /usr/app
COPY . /usr/app
RUN apk add --no-cache jq
# Switch for SaaS or Standalone build
ENV VITE_IS_SAAS_BUILD=true
# Essential vars
ENV VITE_LICENSE_DASHBOARD_URL=https://account.netmaker.io
# Other vars
ENV VITE_NETCLIENT_BIN_URL_TEMPLATE=https://fileserver.netmaker.io/releases/download/:version/:fileName
ENV VITE_NETMAKER_TRIAL_PERIOD_DOCS_URL=https://docs.netmaker.io/docs/server-installation/quick-install#after-trial-period-ends
RUN npm ci
RUN npm audit fix || echo "ATTENTION!!! Failed to automatically patch vulnerabilities" >&2
RUN npm run build
# final image
FROM nginx:1.25.1-alpine3.17
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
COPY ./generate-config.sh /
COPY ./docker-entrypoint.sh /
RUN chmod +x generate-config.sh docker-entrypoint.sh
COPY --from=build /usr/app/dist /usr/share/nginx/html
EXPOSE 80
ENTRYPOINT ["/docker-entrypoint.sh"]