-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.dev
39 lines (29 loc) · 1.24 KB
/
Dockerfile.dev
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
# build environment
FROM node:20 as build
WORKDIR /app
COPY package*.json ./
COPY . .
RUN yarn install
ENV VITE_AUTH_CLIENT="30a25122-c22c-4a5c-a7b8-366d31cb2c46"
ENV VITE_AUTHORITY="https://login.microsoftonline.com/3aa4a235-b6e2-48d5-9195-7fcf05b459b0"
ENV VITE_CONFIG_SCOPE="api://756f2a23-f54d-4643-bb49-62c0db4802ae/Read"
ENV VITE_BASE_URL_MAIN="https://pcs-main-api-dev-pr.azurewebsites.net/api"
ENV VITE_CONFIG_ENDPOINT="https://pcs-config-non-prod-func.azurewebsites.net/api/Frontend/Configuration?"
ENV VITE_WEBAPI_SCOPE="api://47641c40-0135-459b-8ab4-459e68dc8d08/web_api"
ENV VITE_APP_INSIGHTS="cdb49dda-63f9-433d-99f3-c73dff5dc6a1"
ENV VITE_API_VERSION="&api-version=4.1"
RUN yarn build --mode=production
# production environment
FROM docker.io/nginxinc/nginx-unprivileged:alpine
WORKDIR /app
## add permissions for nginx user
COPY --from=build /app/build /usr/share/nginx/html
COPY .docker/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf
COPY .docker/scripts/ /etc/scripts/
# Change the user from root to non-root- From now on, all Docker commands are run as non-root user (except for COPY)
USER 0
RUN chown -R nginx /usr/share/nginx/html \
&& chown -R nginx /etc/nginx/conf.d
USER 9999
EXPOSE 5000
CMD ["sh","/etc/scripts/startup.sh"]