Browse Source

Создание репозитория

Vadim Surkov 7 years ago
commit
7ac9d59000
4 changed files with 47 additions and 0 deletions
  1. 12 0
      Dockerfile
  2. 3 0
      README.md
  3. 14 0
      dev-build-and-store.sh
  4. 18 0
      docker-entrypoint.sh

+ 12 - 0
Dockerfile

@@ -0,0 +1,12 @@
+FROM registry.sdsys.ru/iru/iru-base:0.1
+ENTRYPOINT ["docker-entrypoint.sh"]
+COPY docker-entrypoint.sh /usr/share/web-registry-portal/bin/docker-entrypoint.sh
+ENV PATH=/usr/share/web-registry-portal/bin:$PATH LANG="en_US.UTF-8" ADMIN_HOST=admin
+EXPOSE 9000 2551
+CMD ["web-registry-portal", "-Dpidfile.path=/var/run/web-registry-portal/play.pid", "-Dconfig.file=/etc/web-registry-portal/application.conf", "-Dlogger.file=/etc/web-registry-portal/application-logger.xml"]
+ARG repo=prod
+RUN set -x \           
+           && curl https://repo.infoclinica.ru/yum/centos/sds-${repo}-portal.repo -o /etc/yum.repos.d/sds-${repo}-portal.repo \
+           && chmod +x /usr/share/web-registry-portal/bin/docker-entrypoint.sh \
+           && yum install web-registry-portal -y \
+           && yum clean all 

+ 3 - 0
README.md

@@ -0,0 +1,3 @@
+# Node #
+
+Основное рабочее приложение реализующее  пользовательский web интерфейс и api проекта инфоклиника.ру

+ 14 - 0
dev-build-and-store.sh

@@ -0,0 +1,14 @@
+#!/bin/bash
+
+set -e
+
+build_tag="build-dev-$(date +%Y%m%d-%H%M)"
+echo Build tag $build_tag
+
+docker build --build-arg repo=dev --no-cache -t node:$build_tag .
+#docker build -t node-dev:$build_tag .
+
+docker tag node:$build_tag dev-registry.infoclinica.ru:5000/iru/node:$build_tag
+docker tag node:$build_tag dev-registry.infoclinica.ru:5000/iru/node:dev-latest
+docker push dev-registry.infoclinica.ru:5000/iru/node:$build_tag
+docker push dev-registry.infoclinica.ru:5000/iru/node:dev-latest

+ 18 - 0
docker-entrypoint.sh

@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+
+if [ "$DB_CLUSTER" ]; then
+   sed -i 's/"mongo41\.infoclinica\.lan:27017,mongo42\.infoclinica\.lan:27017,mongo43\.infoclinica\.lan:27017"/\$\{DB_CLUSTER\}/' /etc/web-registry-portal/application.conf
+   sed -i 's/"dev-mongo\.infoclinica\.lan:27017"/\$\{DB_CLUSTER\}/' /etc/web-registry-portal/application.conf
+fi
+
+if [ "$ADMIN_HOST" ]; then
+   sed -i "s/192\.168\.204\.12/$ADMIN_HOST/" /etc/web-registry-portal/application.conf
+   sed -i "s/192\.168\.201\.11/$ADMIN_HOST/" /etc/web-registry-portal/application.conf
+fi
+
+sed -i "s/192\.168\.204\.2x/${HOSTNAME}/" /etc/web-registry-portal/application.conf
+sed -i "s/communication = \"remote\"/communication = \"socket\"/" /etc/web-registry-portal/application.conf
+
+
+exec "$@"
+