A declarative host provisioning system.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

entrypoint.sh 1.2KB

1234567891011121314151617181920212223242526
  1. #!/bin/bash
  2. set -ex
  3. CMD="drydock"
  4. PORT=${PORT:-9000}
  5. # Number of uWSGI workers to handle API requests
  6. DRYDOCK_API_WORKERS=${DRYDOCK_API_WORKERS:-"1"}
  7. # Threads per worker
  8. DRYDOCK_API_THREADS=${DRYDOCK_API_THREADS:-"4"}
  9. # HTTP timeout
  10. HTTP_TIMEOUT=${HTTP_TIMEOUT:-"600"}
  11. if [ "$1" = 'server' ]; then
  12. # Run Drydock under uWSGI
  13. # --http - Port to listen for requests on
  14. # --paste - Use DeployPaste for handling requests and use the specified config INI file
  15. # --enable-threads - Enable the Python GIL so that service can be multithreaded
  16. # -L - Turn off uWSGI request logging, rely totally on logging within the application
  17. # --pyargs - Provide some command line arguments to the Python executable
  18. # --threads - Number of threads each uWSGI worker should use for handling requests
  19. # --workers - Number of uWSGI workers/processes for handling requests
  20. # --http-timeout - How long uWSGI will proxy the python code processing before disconnecting a client
  21. exec uwsgi --http :${PORT} --paste config:/etc/drydock/api-paste.ini --enable-threads -L --pyargv "--config-file /etc/drydock/drydock.conf" --threads $DRYDOCK_API_THREADS --workers $DRYDOCK_API_WORKERS --http-timeout $HTTP_TIMEOUT
  22. fi
  23. exec ${CMD} $@