forked from equinor/witsml-explorer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-frontend
31 lines (27 loc) · 1015 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
FROM node:16-alpine AS builder
WORKDIR /app
COPY Src/WitsmlExplorer.Frontend/package.json ./
COPY yarn.lock ./
RUN yarn install
COPY Src/WitsmlExplorer.Frontend ./
# MSAL settings from optional ARG to ENV with default values
ARG MSALENABLED=
ARG AZURE_AD_TENANT_ID=
ARG AZURE_AD_CLIENT_ID=
ARG AZURE_AD_URL_WITSMLEXPLORER=
ARG AZURE_AD_SCOPE_API=
ENV NEXT_PUBLIC_MSALENABLED=${MSALENABLED}
ENV NEXT_PUBLIC_AZURE_AD_TENANT_ID=${AZURE_AD_TENANT_ID}
ENV NEXT_PUBLIC_AZURE_AD_CLIENT_ID=${AZURE_AD_CLIENT_ID}
ENV NEXT_PUBLIC_AZURE_AD_URL_WITSMLEXPLORER=${AZURE_AD_URL_WITSMLEXPLORER}
ENV NEXT_PUBLIC_AZURE_AD_SCOPE_API=${AZURE_AD_SCOPE_API}
RUN yarn test && yarn build && yarn export
FROM nginx:1.23.2-alpine AS final
ARG EXPOSE_PORT=3000
WORKDIR /usr/share/nginx/html
RUN rm -rf ./*
COPY --from=builder /app/nginx/nginx.conf /etc/nginx/nginx.conf
COPY --from=builder /app/out .
EXPOSE ${EXPOSE_PORT}
RUN mkdir -p /var/cache/nginx && chown nginx:nginx /var/cache/nginx && chown nginx:nginx -R /etc/nginx
USER nginx