entrypoint.sh 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/bin/sh
  2. # vim:sw=4:ts=4:et
  3. grep -r -o "http://fdevops.com:8001" /opt/web |awk -F ':' '{print $1}' | xargs sed -i s"#http://fdevops.com:8001#http://${LISTEN_DOMAIN}:8001#g"
  4. grep -r -o "VUE_APP_BASE_API" /opt/web |awk -F ':' '{print $1}' | xargs sed -i s"#VUE_APP_BASE_API#http://${LISTEN_DOMAIN}:8001#g"
  5. grep -r -o "localhost" /opt/web/static/web/js |awk -F ':' '{print $1}' | xargs sed -i s"#localhost#${LISTEN_DOMAIN}#g"
  6. grep -r -o "fdevops.com" /opt/web/static/web/js |awk -F ':' '{print $1}' | xargs sed -i s"#fdevops.com#${LISTEN_DOMAIN}#g"
  7. set -e
  8. if [ -z "${NGINX_ENTRYPOINT_QUIET_LOGS:-}" ]; then
  9. exec 3>&1
  10. else
  11. exec 3>/dev/null
  12. fi
  13. if [ "$1" = "nginx" -o "$1" = "nginx-debug" ]; then
  14. if /usr/bin/find "/docker-entrypoint.d/" -mindepth 1 -maxdepth 1 -type f -print -quit 2>/dev/null | read v; then
  15. echo >&3 "$0: /docker-entrypoint.d/ is not empty, will attempt to perform configuration"
  16. echo >&3 "$0: Looking for shell scripts in /docker-entrypoint.d/"
  17. find "/docker-entrypoint.d/" -follow -type f -print | sort -n | while read -r f; do
  18. case "$f" in
  19. *.sh)
  20. if [ -x "$f" ]; then
  21. echo >&3 "$0: Launching $f";
  22. "$f"
  23. else
  24. # warn on shell scripts without exec bit
  25. echo >&3 "$0: Ignoring $f, not executable";
  26. fi
  27. ;;
  28. *) echo >&3 "$0: Ignoring $f";;
  29. esac
  30. done
  31. echo >&3 "$0: Configuration complete; ready for start up"
  32. else
  33. echo >&3 "$0: No files found in /docker-entrypoint.d/, skipping configuration"
  34. fi
  35. fi
  36. nginx -g "daemon off;"