Browse Source

change placement of analisserver to /opt

Vadim Surkov 5 years ago
parent
commit
e8bcb8b154
3 changed files with 12 additions and 11 deletions
  1. 3 2
      Dockerfile
  2. 8 8
      entrypoint.sh
  3. 1 1
      healthcheck.sh

+ 3 - 2
Dockerfile

@@ -1,8 +1,9 @@
 FROM registry.sdsys.ru/report:1.1
 
 RUN mkdir -p /root/.wine/drive_c/services/analis
-COPY analis /root/.wine/drive_c/services/analis/
+RUN mkdir -p /opt/analis
+COPY analis /opt/analis/
 COPY healthcheck.sh entrypoint.sh /opt/
-HEALTHCHECK --interval=2m --start-period=3m CMD /opt/healthcheck.sh
+HEALTHCHECK --interval=10s --start-period=3m CMD /opt/healthcheck.sh
 
 ENTRYPOINT ["/opt/entrypoint.sh"]

+ 8 - 8
entrypoint.sh

@@ -2,18 +2,18 @@
 
 if [ ! -z ${LOGPATH} ]
 then
-    ln -s ${LOGPATH} /root/.wine/drive_c/services/analis/log 
+    ln -s ${LOGPATH} /opt/analis/log 
 fi
 echo "Starting AnalisServer.exe $@"
-touch /root/.wine/drive_c/services/analis/log/fatal.log
-ln -s /root/.wine/drive_c/services/analis/log/fatal.log /root/.wine/drive_c/services/analis/fatal.log
-tail -f /root/.wine/drive_c/services/analis/log/fatal.log | while read fread; do echo "[fatal.log]: ${fread}"; done &
+touch /opt/analis/log/fatal.log
+ln -s /opt/analis/log/fatal.log /opt/analis/fatal.log
+tail -f /opt/analis/log/fatal.log | while read fread; do echo "[fatal.log]: ${fread}"; done &
 # See Redmine 111631
 if [ ! -z ${DEBUG} ] && [ ${DEBUG} == "true" ]
 then
-    touch /root/.wine/drive_c/services/analis/debug.log
-    tail -f /root/.wine/drive_c/services/analis/debug.log 2> /dev/null | while read fread; do echo "[debug.log]: ${fread}"; :> /root/.wine/drive_c/services/analis/debug.log; done &
-    exec "/usr/bin/xvfb-run" "-a" "wine" "/root/.wine/drive_c/services/analis/AnalisServer.exe" "/debug" "debugfile=/root/.wine/drive_c/services/analis/debug.log" "$@"
+    touch /opt/analis/debug.log
+    tail -f /opt/analis/debug.log 2> /dev/null | while read fread; do echo "[debug.log]: ${fread}"; :> /root/.wine/drive_c/services/analis/debug.log; done &
+    exec "/usr/bin/xvfb-run" "-a" "wine" "/opt/analis/AnalisServer.exe" "/debug" "debugfile=/opt/analis/debug.log" "$@"
 else
-    exec "/usr/bin/xvfb-run" "-a" "wine" "/root/.wine/drive_c/services/analis/AnalisServer.exe" "$@"
+    exec "/usr/bin/xvfb-run" "-a" "wine" "/opt/analis/AnalisServer.exe" "$@"
 fi

+ 1 - 1
healthcheck.sh

@@ -3,7 +3,7 @@
 # Log difference in seconds
 _LOGDIFF=600
 # Log path
-_LOGDIR="/root/.wine/drive_c/services/analis/log"
+_LOGDIR="/opt/analis/log"
 # Discover latest modified file
 _LOGFILE=$( ls -t -d -1 ${_LOGDIR}/Analis* | head -1 )