entrypoint.sh 911 B

1234567891011121314151617181920212223242526
  1. #! /usr/bin/env bash
  2. set -e
  3. /uwsgi-nginx-entrypoint.sh
  4. # Get the listen port for Nginx, default to 80
  5. USE_LISTEN_PORT=${LISTEN_PORT:-80}
  6. if [ -f /app/nginx.conf ]; then
  7. cp /app/nginx.conf /etc/nginx/nginx.conf
  8. else
  9. content_server='server {\n'
  10. content_server=$content_server" listen ${USE_LISTEN_PORT};\n"
  11. content_server=$content_server' location / {\n'
  12. content_server=$content_server' try_files $uri @app;\n'
  13. content_server=$content_server' }\n'
  14. content_server=$content_server' location @app {\n'
  15. content_server=$content_server' include uwsgi_params;\n'
  16. content_server=$content_server' uwsgi_pass unix:///tmp/uwsgi.sock;\n'
  17. content_server=$content_server' }\n'
  18. content_server=$content_server'}\n'
  19. # Save generated server /etc/nginx/conf.d/nginx.conf
  20. printf "$content_server" > /etc/nginx/conf.d/nginx.conf
  21. fi
  22. exec "$@"