-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (25 loc) · 999 Bytes
/
Dockerfile
File metadata and controls
34 lines (25 loc) · 999 Bytes
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
ARG NODE_VERSION=lts
FROM node:${NODE_VERSION}-alpine as base
WORKDIR /usr/src/app
FROM base as deps
RUN --mount=type=bind,source=package.json,target=package.json \
--mount=type=bind,source=package-lock.json,target=package-lock.json \
--mount=type=cache,target=/root/.npm \
npm ci --omit=dev
FROM deps as build
RUN --mount=type=bind,source=package.json,target=package.json \
--mount=type=bind,source=package-lock.json,target=package-lock.json \
--mount=type=cache,target=/root/.npm \
npm ci
COPY . .
ARG PUBLIC_PATH=/
ENV PUBLIC_PATH=$PUBLIC_PATH
RUN npm run build
FROM nginx:alpine-slim as final
ARG PUBLIC_PATH=/
ENV PUBLIC_PATH=$PUBLIC_PATH
RUN rm -f /etc/nginx/conf.d/default.conf
COPY cfg/80_isp-admin-ui.conf /etc/nginx/conf.d/80_isp-admin-ui.conf
COPY --from=build /usr/src/app/build /opt/msp/isp-admin-ui${PUBLIC_PATH}/
COPY entrypoint.sh /opt/msp/isp-admin-ui${PUBLIC_PATH}/entrypoint.sh
ENTRYPOINT sh -c "/opt/msp/isp-admin-ui${PUBLIC_PATH}/entrypoint.sh"