Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Тэги микрофронтов
- ARG OFKR_FRONT_TAG=master
- ARG MONITORING_FRONT_TAG=master
- ARG DFBS_FRONT_TAG=master
- # Choose builder base image
- FROM nexus-ci.corp.dev.vtb/curs-docker-snapshot/ubi8/nodejs-16:curs AS builder
- # Builder image must contain a certificate /etc/ssl/certs/ca-bundle.crt
- # Default Node image is spkp-docker.nexus-ci.corp.dev.vtb/ubi8/nodejs-14
- # Install app dependencies
- ARG NEXUS_LOGIN
- ARG NEXUS_PASSWORD
- COPY package.json package-lock.json ./
- RUN npm config set registry https://nexus-ci.corp.dev.vtb/repository/spkp-npm \
- && npm config set @vtb:registry https://nexus-ci.corp.dev.vtb/repository/pfomb-npm \
- && npm config set @vtb-curs:registry https://nexus-ci.corp.dev.vtb/repository/spkp-npm-lib \
- && npm config set @d11t:registry https://nexus-ci.corp.dev.vtb/repository/spkp-npm-lib \
- && npm config set audit false \
- && npm config set cafile /etc/ssl/certs/ca-bundle.crt \
- && npm config set always-auth true \
- && npm config set _auth $(echo -n "${NEXUS_LOGIN}:${NEXUS_PASSWORD}" | base64) \
- && npm ci
- # ========================================================================
- # Everyhing above here should change rarely to benefit from docker caching
- # ========================================================================
- # Copy source code and pre-build artifacts
- COPY . .
- # Build app
- USER root
- ARG APP_BASE_URL=/ui/smb/frnt/curs/curs-ui/
- ARG APP_ASSETS_PREFIX=/ui/smb/frnt/curs/curs-ui/
- ARG PORT
- RUN npm run build \
- && npm prune --production \
- && chown -R root:root node_modules
- # ======================================
- # Everyhing above here is the build step
- # ======================================
- # Агрегируем другие микрофронты в нашем рутовом приложении
- FROM nexus-ci.corp.dev.vtb/curs-docker-snapshot/curs/ofkr-front:$OFKR_FRONT_TAG AS ofkr
- FROM nexus-ci.corp.dev.vtb/curs-docker-snapshot/curs/monitoring-front:$MONITORING_FRONT_TAG AS monitoring
- FROM nexus-ci.corp.dev.vtb/curs-docker-snapshot/curs/dfbs-front:$DFBS_FRONT_TAG AS dfbs
- # Собираемся от требуемого nginx образа
- FROM nexus-ci.corp.dev.vtb/public-docker-proxy-registry-redhat-io/rhel8/nginx-118
- USER root
- RUN mkdir /app
- WORKDIR /app
- RUN chmod 777 /app
- USER 1001
- COPY config/default.conf /opt/app-root/etc/nginx.d/default.conf
- COPY config/nginx.conf /etc/nginx/nginx.conf
- COPY --from=builder /opt/app-root/src/dist .
- # Кладём микрофронты в их папки
- COPY --from=ofkr /opt/app-root/src/dist ./ofkr-front-app
- COPY --from=monitoring /opt/app-root/src/dist ./monitoring-front-app
- COPY --from=dfbs /opt/app-root/src/dist ./dfbs-front-app
- CMD ["nginx", "-g", "daemon off;"]
Add Comment
Please, Sign In to add comment