-
Notifications
You must be signed in to change notification settings - Fork 12
/
Dockerfile.standalone
68 lines (49 loc) · 1.89 KB
/
Dockerfile.standalone
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
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=false
# Standalone build mandatory vars
# This value is used if `BACKEND_URL` env var is unset.
# BACKEND_URL is used for dynamic URL injection
ENV VITE_BASE_URL=
ENV VITE_LICENSE_DASHBOARD_URL=https://account.netmaker.io
# EE customisations and branding
ENV VITE_PRODUCT_NAME=
ENV VITE_TENANT_LOGO_DARK_URL=
ENV VITE_TENANT_LOGO_LIGHT_URL=
ENV VITE_TENANT_LOGO_DARK_SMALL_URL=
ENV VITE_TENANT_LOGO_LIGHT_SMALL_URL=
ENV VITE_TENANT_LOGO_ALT_TEXT=
ENV VITE_TENANT_FAVICON_LOGO=
ENV VITE_TENANT_PRIMARY_COLOR=
# 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/install.html#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"]