Deploy a Flask app
This guide replaces the old “How to deploy a Flask app on DockHive” page.
With Drone (recommended)
Section titled “With Drone (recommended)”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.
With the Flask preset
Section titled “With the Flask preset”Pick Flask. DockHive installs requirements.txt and serves your app with gunicorn.
from flask import Flask
app = Flask(__name__)
@app.get("/")def index(): return "Hello from DockHive"flaskgunicornIf your app object isn’t app in app.py, set the Start Command in Advanced Settings, for example:
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-versionfile containing, for example,3.11. - Put your database URL and secret key in environment variables.