Jelajahi Sumber

ENTRYPOINT: чтение параметров из /etc/init.d/web-registry-portal

wadim 7 tahun lalu
induk
melakukan
8e8229fb16
2 mengubah file dengan 7 tambahan dan 2 penghapusan
  1. 1 1
      Dockerfile
  2. 6 1
      docker-entrypoint.sh

+ 1 - 1
Dockerfile

@@ -4,7 +4,7 @@ COPY docker-entrypoint.sh /usr/share/web-registry-portal/bin/docker-entrypoint.s
 ENV PATH=/usr/share/web-registry-portal/bin:$PATH LANG="en_US.UTF-8" ADMIN_HOST=admin
 EXPOSE 9000 2551
 HEALTHCHECK --start-period=30s --interval=15s --timeout=5s --retries=2 CMD curl -f -H 'Host:demo.infoclinica.ru' 127.0.0.1:9000/login || exit 1
-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"]
+#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 \

+ 6 - 1
docker-entrypoint.sh

@@ -13,6 +13,11 @@ 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
 
+echo "#Dummy" >> /etc/rc.d/init.d/functions
+source /etc/init.d/web-registry-portal status
 
-exec "$@"
+if [ ! -z "$@" ]
+    exec "$@"
+else
+    exec "${WEB_REGISTRY_BIN} ${WEB_REGISTRY_OPTS}"