Migrations Migrating from Heroku, Render, Hatchbox or Cloud 66? We move your production app within 48 hours →
Flask

Flask

Deploy Flask with gunicorn, Postgres, migrations and RQ or Celery workers.

  • Detected from requirements.txt or pyproject.toml listing flask.
  • Web: gunicorn on $PORT with app:app. If your app lives elsewhere, set the start command to your module: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. A Procfile release: line is used when present.
  • Database: psycopg → Postgres, with DATABASE_URL injected.
  • Workers and cron: RQ is offered when it’s a dependency. For Celery, add worker: celery -A myapp.celery worker to your Procfile or 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 and DATABASE_URL, and deploys on every push.
  • From the CLI: railyard create my-app https://github.com/me/my-app --addons postgres,redis, or railyard git:remote && git push railyard main from 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.
Found an issue or have a question?
Theme
Colors