Indigo
Indigo copied to clipboard
The Gunicorn server should be configurable with regard to the address, the port and the user.
Background The Gunicorn server should be configurable with regard to the address, the port and the user. This increases flexibility when used in Kubernetes or a multi-service environment.
Solution Adjustment of the gunicorn.auto.conf -> https://github.com/epam/Indigo/blob/1b5bb8808b73b6613d2e96b9a95eefc6b1a15b02/utils/indigo-service/backend/conf/gunicorn.auto.conf And Default Envs in the Dockerfile -> https://github.com/epam/Indigo/blob/1b5bb8808b73b6613d2e96b9a95eefc6b1a15b02/utils/indigo-service/backend/Dockerfile
gunicorn.auto.conf:
[program:gunicorn]
directory=/srv/api
user=%(ENV_guuser)s
command=/bin/bash -c "gunicorn --bind %(ENV_guaddress)s:%(ENV_guport)s --workers=$(nproc) app:app"
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
killasgroup=true
dockerfile (add):
# default gunicorn bind
ENV guaddress 0.0.0.0
ENV guport 80
# default gunicorn user
ENV guuser root