Flask
Deploy Flask with gunicorn, Postgres, migrations and RQ or Celery workers.
Step by step: Deploy Flask to DigitalOcean · Deploy Flask to Hetzner · Deploy Flask to Vultr · Deploy Flask to OVHcloud · Deploy Flask to Scaleway · Deploy Flask to UpCloud
- Detected from
requirements.txtorpyproject.tomllistingflask. - Web: gunicorn on
$PORTwithapp:app. If your app lives elsewhere, set the start command to yourmodule:callable(for an app factory,"myapp:create_app()"). - Release: none by default. With Flask-Migrate, set it to
flask db upgrade; with Alembic,alembic upgrade head. AProcfilerelease:line is used when present. - Database:
psycopg→ Postgres, withDATABASE_URLinjected. - Workers and cron: RQ is offered when it’s a dependency. For Celery, add
worker: celery -A myapp.celery workerto yourProcfileor add it on the Workers tab.
Workers are a second process of the same app
Flask has no single worker convention of its own, so Railyard just applies the 12-factor rule directly: declare a second process in your Procfile and it scales independently of web.
web: gunicorn app:app --bind 0.0.0.0:$PORT
worker: rq worker --url $REDIS_URL
Or add it on the app’s Workers tab without touching the repo, and scale either one from the CLI:
railyard scale my-app worker=2
RQ is offered automatically when it’s a dependency; Celery isn’t auto-detected for Flask — there’s no single convention for where the Celery app lives — so declare its command once yourself. See Workers and scheduled jobs for cron: either a scheduled command there, or a second worker process running celery -A myapp.celery beat.
Config and secrets
DATABASE_URL is injected once psycopg/psycopg2 is a dependency, and REDIS_URL once a Redis client (redis, rq) is. Everything else — SECRET_KEY, FLASK_ENV, feature flags — is a plain env var under Variables, or railyard env:set my-app KEY=VALUE from the CLI, so the same image runs unchanged from staging through production: dev/prod parity, not a build-time branch. Point at a database or Redis running as its own service on the canvas with ${{redis.RAILYARD_PRIVATE_URL}} — resolved per environment. See Variables and secrets.
Deploy it
- From a repo: paste the Git URL, or pick it from the picker once GitHub is connected — Railyard reads
requirements.txt/pyproject.toml, fills in gunicorn andDATABASE_URL, and deploys on every push. - From the CLI:
railyard create my-app https://github.com/me/my-app --addons postgres,redis, orrailyard git:remote && git push railyard mainfrom inside the repo. - One click: add the deploy button to your README, or publish to the template catalog so anyone can launch it with its addons and variables already filled in.