Hurdle in launching a Flask application on AWS Lightsail

0

The original project code is on VS Code. Pushed the application's image repository to DockerHub.com and from there pushed to AWS Lightsail.

Here is the status on Amazon CLI:

Last login: Mon Jun 17 10:13:58 2024 from 54.239.98.244
ubuntu@ip-172-26-15-239:~$ docker logs fcf0db26a49a
 * Serving Flask app 'app'
 * Debug mode: on
WARNING: This is a development server. Do not use it in a production deployment. Use a p
roduction WSGI server instead.
 * Running on http://127.0.0.1:5000
Press CTRL+C to quit
 * Restarting with stat
 * Debugger is active!
 * Debugger PIN: 107-751-001
 * Serving Flask app 'app'
 * Debug mode: on

Unable to figure out why nothing loading on http://127.0.0.1:5000. Since the static IP address for this instance is 44.206.118.123, also tried with http://44.206.118.123. But blank page.

If access to app.py file or any other files such as requirements.txt/DockerHub needed in order to troubleshoot, I will provide. Not providing just now for the sake of brevity.

The above project is just for display and not mission critical. As of now, my goal is to make the project live (can be viewed by anyone using the url or IP address).

profile picture
질문됨 7달 전368회 조회
2개 답변
2
수락된 답변

Hello,

I would recommend to check that your Flask app config app.py is configured to run on all network interfaces (0.0.0.0) and on the correct port (5000).

if __name__ == "__main__":
    app.run(host="0.0.0.0", port=5000)

You can follow this tutorial to deploy Flask application to Light Sail: https://aws.amazon.com/tutorials/serve-a-flask-app/

profile picture
전문가
답변함 7달 전
profile picture
전문가
검토됨 7달 전
profile picture
전문가
검토됨 7달 전
0

http://44.206.118.123:8080/ Same source code on AWS Lightsail (Ubuntu) showing internal server error once the form submitted though working fine on VS Studio (https://www.canva.com/design/DAGIZJrhyIk/EYzsYG5sfXMmEazS77EQ1w/edit?utm_content=DAGIZJrhyIk&utm_campaign=designshare&utm_medium=link2&utm_source=sharebutton).

profile picture
답변함 7달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠