We have environment variables for where gunicorn is listening, so we should use those to generate the proper URL instead of using a hard-coded argument in the Dockerfile.
I'd suggest instead of an error, we should format a string as the URL instead. This preserves the ability to override the URL with an argument but uses the generated one by default.
|
try: |
|
url = sys.argv[1] |
|
except IndexError: |
|
sys.stderr.write('URL must be supplied\n') |
|
sys.exit(1) |
|
def get_bind(): |
|
host = os.getenv('LISTEN_HOST', '127.0.0.1') |
|
port = os.getenv('LISTEN_PORT', '8080') |
|
return '{}:{}'.format(host, port) |
|
|
|
|
|
# Create a healthcheck |
|
HEALTHCHECK --interval=1m --timeout=10s --start-period=3m CMD ["/app/healthcheck.py", "http://127.0.0.1:8080/healthcheck"] |
|
|
We have environment variables for where
gunicornis listening, so we should use those to generate the proper URL instead of using a hard-coded argument in theDockerfile.I'd suggest instead of an error, we should format a string as the URL instead. This preserves the ability to override the URL with an argument but uses the generated one by default.
tubesync/tubesync/healthcheck.py
Lines 38 to 42 in 33479e8
tubesync/tubesync/tubesync/gunicorn.py
Lines 19 to 24 in 33479e8
tubesync/Dockerfile
Lines 776 to 778 in 33479e8