Skip to content

Deploy a Flask app

This guide replaces the old “How to deploy a Flask app on DockHive” page.

Push your code to GitHub, start a new app, pick the repository and click Deploy with Drone. Or run hivepod deploy in the project folder.

Pick Flask. DockHive installs requirements.txt and serves your app with gunicorn.

app.py
from flask import Flask
app = Flask(__name__)
@app.get("/")
def index():
return "Hello from DockHive"
requirements.txt
flask
gunicorn

If your app object isn’t app in app.py, set the Start Command in Advanced Settings, for example:

Terminal window
gunicorn --bind 0.0.0.0:$PORT "myproject:create_app()"
  • Don’t use Flask’s development server (app.run()) in production.
  • To pick a Python version (3.9 to 3.13; the default is 3.12), add a .python-version file containing, for example, 3.11.
  • Put your database URL and secret key in environment variables.