-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
45 lines (41 loc) · 1.97 KB
/
Dockerfile
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
FROM node:18.16.0
ENV VITE_PORTAL_SERVER_URL=$VITE_PORTAL_SERVER_URL \
VITE_CLIENT_ID=$VITE_CLIENT_ID \
VITE_TOKEN_ENDPOINT=$VITE_TOKEN_ENDPOINT \
VITE_AUTH_ENDPOINT=$VITE_AUTH_ENDPOINT \
VITE_LOGOUT_ENDPOINT=$VITE_LOGOUT_ENDPOINT \
VITE_APPLIED_OIDC_AUTH_CODE_CONFIG=$VITE_APPLIED_OIDC_AUTH_CODE_CONFIG \
VITE_OIDC_AUTH_CODE_CONFIG_CALLBACK_PATH=$VITE_OIDC_AUTH_CODE_CONFIG_CALLBACK_PATH \
VITE_OIDC_AUTH_CODE_CONFIG_LOGOUT_PATH=$VITE_OIDC_AUTH_CODE_CONFIG_LOGOUT_PATH \
VITE_SWAGGER_CONFIG_URL=$VITE_SWAGGER_CONFIG_URL \
VITE_AUDIENCE=$VITE_AUDIENCE \
VITE_HOME_IMAGE_URL=$VITE_HOME_IMAGE_URL \
VITE_APIS_IMAGE_URL=$VITE_APIS_IMAGE_URL \
VITE_LOGO_IMAGE_URL=$VITE_LOGO_IMAGE_URL \
VITE_COMPANY_NAME=$VITE_COMPANY_NAME
# Copy files for build
WORKDIR /app
COPY ./projects projects
WORKDIR /app/projects/ui
# Install global dependencies and set up for runtime
RUN apt-get update && apt-get install -y build-essential
RUN yarn install
EXPOSE 4000
# Build the app and pass in the environment variables, then start it.
# The build can't happen in 2 stages (build and runtime),
# since these variables will change when the image is deployed.
ENTRYPOINT VITE_PORTAL_SERVER_URL=$VITE_PORTAL_SERVER_URL \
VITE_CLIENT_ID=$VITE_CLIENT_ID \
VITE_TOKEN_ENDPOINT=$VITE_TOKEN_ENDPOINT \
VITE_AUTH_ENDPOINT=$VITE_AUTH_ENDPOINT \
VITE_LOGOUT_ENDPOINT=$VITE_LOGOUT_ENDPOINT \
VITE_APPLIED_OIDC_AUTH_CODE_CONFIG=$VITE_APPLIED_OIDC_AUTH_CODE_CONFIG \
VITE_OIDC_AUTH_CODE_CONFIG_CALLBACK_PATH=$VITE_OIDC_AUTH_CODE_CONFIG_CALLBACK_PATH \
VITE_OIDC_AUTH_CODE_CONFIG_LOGOUT_PATH=$VITE_OIDC_AUTH_CODE_CONFIG_LOGOUT_PATH \
VITE_SWAGGER_CONFIG_URL=$VITE_SWAGGER_CONFIG_URL \
VITE_AUDIENCE=$VITE_AUDIENCE \
VITE_HOME_IMAGE_URL=$VITE_HOME_IMAGE_URL \
VITE_APIS_IMAGE_URL=$VITE_APIS_IMAGE_URL \
VITE_LOGO_IMAGE_URL=$VITE_LOGO_IMAGE_URL \
VITE_COMPANY_NAME=$VITE_COMPANY_NAME \
yarn build && yarn run vite preview --port 4000 --host