Gunicorn working in Docker but not in AWS Beanstalk

Viewed 67

My flask app is structured as

webapp
  -- __init___.py    (app and server are initialized here)
  -- stuff.py
Dockerfile
entrypoint.sh

Dockerfile last line: ENTRYPOINT ["sh","./entrypoint.sh"]

Inside entrypoint.sh: gunicorn -w 1 --timeout 1800 --bind :80 webapp:server Also tried webapp.__init__:server, webapp:app.server, webapp:app

This works on docker with the following result:

[INFO] Starting gunicorn 20.1.0
[INFO] Listening at: http://0.0.0.0:80 (9)
[INFO] Using worker: sync
[INFO] Booting worker with pid: 11

but running on AWS beanstalk I get the follow:

[INFO] Starting gunicorn 20.1.0
[INFO] Listening at: http://0.0.0.0:80 (9)
[INFO] Using worker: sync
[INFO] Booting worker with pid: 11
Failed to find attribute 'server' in 'webapp'.
[INFO] Worker exiting (pid: 11)
[INFO] Shutting down: Master
[INFO] Reason: App failed to load.

server is inside webapp. Can gunicorn not handle __init__.py? But it works on local docker.

0 Answers
Related