39 lines
1.5 KiB
Docker
39 lines
1.5 KiB
Docker
FROM node:14-buster AS build
|
|
|
|
WORKDIR /app
|
|
|
|
COPY package.json package-lock.json ./
|
|
|
|
RUN apt-get update && \
|
|
apt-get install -y --no-install-recommends python make g++ && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
RUN npm install -g npm@9
|
|
RUN npm pkg delete dependencies.node
|
|
|
|
ARG PAT=vvqu3q252m5kqwptu4tavha4ghk4svhmwsahb2kvlu22ogiegt6q
|
|
RUN TOKEN="$(printf "%s" "${PAT}" | base64 | tr -d '\n')" && \
|
|
printf "registry=https://landmarkcu.pkgs.visualstudio.com/_packaging/LCU-Internal/npm/registry/\n" > .npmrc && \
|
|
printf "always-auth=true\n" >> .npmrc && \
|
|
printf "//landmarkcu.pkgs.visualstudio.com/_packaging/LCU-Internal/npm/registry/:username=azdo\n" >> .npmrc && \
|
|
printf "//landmarkcu.pkgs.visualstudio.com/_packaging/LCU-Internal/npm/registry/:_password=%s\n" "${TOKEN}" >> .npmrc && \
|
|
printf "//landmarkcu.pkgs.visualstudio.com/_packaging/LCU-Internal/npm/registry/:[email protected]\n" >> .npmrc && \
|
|
printf "//landmarkcu.pkgs.visualstudio.com/_packaging/LCU-Internal/npm/:username=azdo\n" >> .npmrc && \
|
|
printf "//landmarkcu.pkgs.visualstudio.com/_packaging/LCU-Internal/npm/:_password=%s\n" "${TOKEN}" >> .npmrc && \
|
|
printf "//landmarkcu.pkgs.visualstudio.com/_packaging/LCU-Internal/npm/:[email protected]\n" >> .npmrc
|
|
|
|
RUN npm install --unsafe-perm
|
|
|
|
COPY . ./
|
|
|
|
RUN npm run build
|
|
|
|
FROM nginx:1.27-alpine
|
|
|
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
COPY --from=build /app/build /usr/share/nginx/html
|
|
|
|
EXPOSE 80
|
|
|
|
CMD ["nginx", "-g", "daemon off;"]
|