Browse Source

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

Vadim Surkov 7 years ago
commit
4e56744a6b
4 changed files with 50 additions and 0 deletions
  1. 21 0
      Dockerfile
  2. 3 0
      README.md
  3. 13 0
      dev-build-and-store.sh
  4. 13 0
      docker-entrypoint.sh

+ 21 - 0
Dockerfile

@@ -0,0 +1,21 @@
+FROM registry.sdsys.ru/iru/iru-base:0.1
+ENTRYPOINT ["docker-entrypoint.sh"]
+COPY docker-entrypoint.sh /opt/tomcat8/bin/docker-entrypoint.sh
+ENV CATALINA_HOME="/opt/tomcat8" 
+ENV PATH=$CATALINA_HOME/bin:$PATH \
+    CATALINA_OPTS="-Dconfig.file=/etc/web-infoclinic/application.conf" \
+    JAVA_HOME=/usr/java/default \
+    JAVA_OPTS="-Xms512M -Xmx1024M -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv4Addresses=true" \
+    WORKDIR=$CATALINA_HOME \
+    DB_CLUSTER=mongodb
+EXPOSE 8080 8009 2551
+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 \
+           && yum install tomcat8 -y \
+           && yum install web-registry-admin -y \
+           && yum clean all \
+           && chmod +x /opt/tomcat8/bin/docker-entrypoint.sh \
+           && chown -R tomcat:tomcat /etc/web-infoclinic
+USER tomcat
+CMD ["catalina.sh", "run"]

+ 3 - 0
README.md

@@ -0,0 +1,3 @@
+# Admin #
+
+Приложение реализующее "админку" проекта инфоклиника.ру

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

@@ -0,0 +1,13 @@
+#!/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 admin:$build_tag .
+
+docker tag admin:$build_tag dev-registry.infoclinica.ru:5000/iru/admin:$build_tag
+docker tag admin:$build_tag dev-registry.infoclinica.ru:5000/iru/admin:dev-latest
+docker push dev-registry.infoclinica.ru:5000/iru/admin:$build_tag
+docker push dev-registry.infoclinica.ru:5000/iru/admin:dev-latest

+ 13 - 0
docker-entrypoint.sh

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