Question
Flask application with gunicorn in the app platform does not work
I have a flask application that I am trying to run in the app of platforms with a gunicorn.
wsgi.py
from app import create_app
app = create_app()
if __name__ == '__main__':
app.run()
gconfig.py
from multiprocessing import cpu_count
bind = '0.0.0.0:8080'
workers = (2 * cpu_count()) + 1
worker_class = 'gevent'
worker_connections = 1000
timeout = 60
Run Command
gunicorn --worker-tmp-dir /dev/shm -c gconfig.py wsgi:app
After the build in the logs:
app-name | 2021-01-20 15:24:25 [2021-01-20 13:24:25 +0000] [1] [INFO] Starting gunicorn 20.0.4
app-name | 2021-01-20 15:24:25 [2021-01-20 13:24:25 +0000] [1] [INFO] Listening at: http://0.0.0.0:8080 (1)
app-name | 2021-01-20 15:24:25 [2021-01-20 13:24:25 +0000] [1] [INFO] Using worker: gevent
app-name | 2021-01-20 15:24:25 [2021-01-20 13:24:25 +0000] [11] [INFO] Booting worker with pid: 11
app-name | 2021-01-20 15:24:25 [2021-01-20 13:24:25 +0000] [12] [INFO] Booting worker with pid: 12
app-name | 2021-01-20 15:24:25 [2021-01-20 13:24:25 +0000] [13] [INFO] Booting worker with pid: 13
app-name | 2021-01-20 15:24:25 [2021-01-20 13:24:25 +0000] [14] [INFO] Booting worker with pid: 14
app-name | 2021-01-20 15:24:26 [2021-01-20 13:24:25 +0000] [15] [INFO] Booting worker with pid: 15
app-name | 2021-01-20 15:24:26 [2021-01-20 13:24:26 +0000] [16] [INFO] Booting worker with pid: 16
app-name | 2021-01-20 15:24:26 [2021-01-20 13:24:26 +0000] [17] [INFO] Booting worker with pid: 17
app-name | 2021-01-20 15:24:26 [2021-01-20 13:24:26 +0000] [18] [INFO] Booting worker with pid: 18
app-name | 2021-01-20 15:24:27 [2021-01-20 13:24:27 +0000] [19] [INFO] Booting worker with pid: 19
app-name | 2021-01-20 15:24:27 [2021-01-20 13:24:27 +0000] [20] [INFO] Booting worker with pid: 20
app-name | 2021-01-20 15:24:28 [2021-01-20 13:24:28 +0000] [21] [INFO] Booting worker with pid: 21
app-name | 2021-01-20 15:24:29 [2021-01-20 13:24:28 +0000] [22] [INFO] Booting worker with pid: 22
app-name | 2021-01-20 15:24:29 [2021-01-20 13:24:29 +0000] [23] [INFO] Booting worker with pid: 23
app-name | 2021-01-20 15:24:30 [2021-01-20 13:24:30 +0000] [24] [INFO] Booting worker with pid: 24
app-name | 2021-01-20 15:24:30 [2021-01-20 13:24:30 +0000] [25] [INFO] Booting worker with pid: 25
app-name | 2021-01-20 15:24:31 [2021-01-20 13:24:31 +0000] [26] [INFO] Booting worker with pid: 26
app-name | 2021-01-20 15:24:32 [2021-01-20 13:24:32 +0000] [27] [INFO] Booting worker with pid: 27
When I go to the url, then in the browser I just have the text:
no healthy upstream
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×