doable.do

Python + Doable

How to deploy a FastAPI app with Doable

Doable runs FastAPI apps as standard Python containers. Doable detects FastAPI from `requirements.txt` (or `pyproject.toml`), installs your dependencies, and starts the app behind HTTPS, no Dockerfile, no platform-specific config.

If you need a database, attach an external Postgres in one command. Most FastAPI apps deploy in 30–60 seconds.

Step by step

  1. 1

    Make sure you have a requirements.txt

    Doable's detector reads it to know which framework to start. Pin `fastapi`, `uvicorn`, and any deps.

    fastapi uvicorn[standard]
  2. 2

    Install the CLI

    Or use the MCP plugin from Claude Code.

    npm install -g doable-cli
  3. 3

    Deploy

    From your project directory. Doable detects FastAPI, runs `pip install -r requirements.txt`, and starts `uvicorn` on the detected entry module.

    doable deploy
  4. 4

    Attach a Postgres (optional)

    Pulls the connection string into your project as an encrypted env var. Use Neon, Supabase, Upstash, or any URL.

    doable addon attach postgres "postgresql://user:pass@host/db"

How Doable detects FastAPI

The build worker reads `requirements.txt` (or `pyproject.toml` / `Pipfile`). If it sees `fastapi`, it installs your deps and starts uvicorn pointing at the detected app entry, typically `main:app` or `app:app`. The exposed port defaults to 8000 unless you specify `PORT` in env vars.

If your entry module isn't auto-detected, drop a Dockerfile in the repo root and Doable uses it as-is. The Dockerfile escape hatch is the same as for any other runtime.

Common patterns

Background workers: deploy your worker as a separate Doable project with no public port. The container runs continuously and processes jobs from your queue (Redis, SQS, Celery, etc.). The `addon attach` flow handles Redis the same way as Postgres.

Async tasks: combine FastAPI with `asyncio` or `apscheduler` for in-process scheduling. For external schedulers, point Upstash QStash or Trigger.dev at a public endpoint on your deployed app.

FAQ

Do I need a Dockerfile for FastAPI?

No. Doable auto-detects FastAPI from `requirements.txt` and runs the standard install + uvicorn flow. Use a Dockerfile only if you need system packages or a custom build step.

Which Python version does Doable use?

Doable picks the latest stable 3.x by default. If you need a specific version, add a `.python-version` file or pin in your Dockerfile.

How do I run database migrations on deploy?

Use the project's start script (or Dockerfile entrypoint) to run `alembic upgrade head` before starting uvicorn. Migrations run on every container start, but Alembic is idempotent so this is safe.

Does Doable support websockets?

Yes. The agent runs your container behind Traefik with no per-request timeout, so FastAPI websocket endpoints work without extra configuration.

Try Doable free

No credit card. Deploy your first project in under a minute.