---
title: "Discussion on \"Deploy Containerized Python Flask App to Heroku\" | Hashnode"
description: "Discussion on \"Deploy Containerized Python Flask App to Heroku\". App.py\nIn the main function, ensure you have the following code to get the port from the os environment\nif __name__ == '__main__':\n    port = int(os.environ.get(\"PORT\", 6000))\n    app.run(host=\"0.0.0.0\", port=port, debug=True)\n\nDockerfile\n# syntax=do..."
url: "https://hashnode.com/posts/deploy-containerized-python-flask-app-to-heroku/6646ed7bec9adbf1532a94dd"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Deploy Containerized Python Flask App to Heroku](https://fanthoni.hashnode.dev/deploy-containerized-python-flask-app-to-heroku?utm_source=hashnode&utm_medium=feed)

App.py In the main function, ensure you have the following code to get the port from the os environment if \_\_name\_\_ == '\_\_main\_\_': port = int(os.environ.get("PORT", 6000)) app.run(host="0.0.0.0", port=port, debug=True) Dockerfile # syntax=do...

May 17, 2024 · 1 min read · fanthoni.hashnode.dev  
Updated May 26, 2024  
Read the article

## Written by

[Ferrel Anthoni](https://hashnode.com/@Fanthoni)

@Fanthoni

  
[View profile](https://hashnode.com/@Fanthoni)

QAE @ Trulioo

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
