forked from equinor/witsml-explorer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-frontend
31 lines (27 loc) · 961 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:20-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 VITE_MSALENABLED=${MSALENABLED}
ENV VITE_AZURE_AD_TENANT_ID=${AZURE_AD_TENANT_ID}
ENV VITE_AZURE_AD_CLIENT_ID=${AZURE_AD_CLIENT_ID}
ENV VITE_AZURE_AD_URL_WITSMLEXPLORER=${AZURE_AD_URL_WITSMLEXPLORER}
ENV VITE_AZURE_AD_SCOPE_API=${AZURE_AD_SCOPE_API}
RUN yarn test && yarn build
FROM nginx:1-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/dist .
EXPOSE ${EXPOSE_PORT}
RUN mkdir -p /var/cache/nginx && chown nginx:nginx /var/cache/nginx && chown nginx:nginx -R /etc/nginx
USER nginx