crutch12

frkk.Dockerfile

Jan 21st, 2022
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.75 KB | None | 0 0
  1. # Тэги микрофронтов
  2. ARG OFKR_FRONT_TAG=master
  3. ARG MONITORING_FRONT_TAG=master
  4. ARG DFBS_FRONT_TAG=master
  5.  
  6. # Choose builder base image
  7. FROM nexus-ci.corp.dev.vtb/curs-docker-snapshot/ubi8/nodejs-16:curs AS builder
  8.  
  9. # Builder image must contain a certificate /etc/ssl/certs/ca-bundle.crt
  10. # Default Node image is spkp-docker.nexus-ci.corp.dev.vtb/ubi8/nodejs-14
  11.  
  12. # Install app dependencies
  13. ARG NEXUS_LOGIN
  14. ARG NEXUS_PASSWORD
  15.  
  16. COPY package.json package-lock.json ./
  17.  
  18. RUN npm config set registry https://nexus-ci.corp.dev.vtb/repository/spkp-npm \
  19.     && npm config set @vtb:registry https://nexus-ci.corp.dev.vtb/repository/pfomb-npm \
  20.     && npm config set @vtb-curs:registry https://nexus-ci.corp.dev.vtb/repository/spkp-npm-lib \
  21.     && npm config set @d11t:registry https://nexus-ci.corp.dev.vtb/repository/spkp-npm-lib \
  22.     && npm config set audit false \
  23.     && npm config set cafile /etc/ssl/certs/ca-bundle.crt \
  24.     && npm config set always-auth true \
  25.     && npm config set _auth $(echo -n "${NEXUS_LOGIN}:${NEXUS_PASSWORD}" | base64) \
  26.     && npm ci
  27.  
  28.  
  29. # ========================================================================
  30. # Everyhing above here should change rarely to benefit from docker caching
  31. # ========================================================================
  32.  
  33.  
  34. # Copy source code and pre-build artifacts
  35. COPY . .
  36.  
  37. # Build app
  38. USER root
  39.  
  40. ARG APP_BASE_URL=/ui/smb/frnt/curs/curs-ui/
  41. ARG APP_ASSETS_PREFIX=/ui/smb/frnt/curs/curs-ui/
  42. ARG PORT
  43.  
  44. RUN npm run build \
  45.     && npm prune --production \
  46.     && chown -R root:root node_modules
  47.  
  48.  
  49. # ======================================
  50. # Everyhing above here is the build step
  51. # ======================================
  52.  
  53. # Агрегируем другие микрофронты в нашем рутовом приложении
  54. FROM nexus-ci.corp.dev.vtb/curs-docker-snapshot/curs/ofkr-front:$OFKR_FRONT_TAG AS ofkr
  55. FROM nexus-ci.corp.dev.vtb/curs-docker-snapshot/curs/monitoring-front:$MONITORING_FRONT_TAG AS monitoring
  56. FROM nexus-ci.corp.dev.vtb/curs-docker-snapshot/curs/dfbs-front:$DFBS_FRONT_TAG AS dfbs
  57.  
  58. # Собираемся от требуемого nginx образа
  59. FROM nexus-ci.corp.dev.vtb/public-docker-proxy-registry-redhat-io/rhel8/nginx-118
  60.  
  61. USER root
  62. RUN mkdir /app
  63. WORKDIR /app
  64. RUN chmod 777 /app
  65. USER 1001
  66.  
  67. COPY config/default.conf /opt/app-root/etc/nginx.d/default.conf
  68. COPY config/nginx.conf  /etc/nginx/nginx.conf
  69.  
  70. COPY --from=builder /opt/app-root/src/dist .
  71. # Кладём микрофронты в их папки
  72. COPY --from=ofkr /opt/app-root/src/dist ./ofkr-front-app
  73. COPY --from=monitoring /opt/app-root/src/dist ./monitoring-front-app
  74. COPY --from=dfbs /opt/app-root/src/dist ./dfbs-front-app
  75.  
  76. CMD ["nginx", "-g", "daemon off;"]
Add Comment
Please, Sign In to add comment