You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/deploy/build-requirements.mdx
+39-14Lines changed: 39 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,17 +10,24 @@ When you run `faable deploy`, the CLI inspects your repository, detects the stac
10
10
11
11
## 🔍 How Detection Works
12
12
13
-
The builder checks for these files at the project root, **in order** — the first match decides the runtime:
13
+
Deploys are built by **buildpacks** (Heroku/CNB-style): each one checks for its trigger files at the project root, **in order** — the first match decides how your app is built:
| 2 |`requirements.txt`, `pyproject.toml`, `Pipfile`, or `cerebrium.toml`|**Python** (see below) |
19
+
| 3 |`Dockerfile`|**Docker** — your Dockerfile, built verbatim |
20
+
| 4 |`main.py`, `app.py`, or `wsgi.py` (fallback, no manifest at all) |**Python** without dependency install (see below) |
21
+
| — | None of the above | ❌ Deploy fails with a diagnostic listing what was looked for, what your repo contains, and any config from another platform it recognizes |
21
22
22
23
> [!IMPORTANT]
23
-
> The order matters: if your repo has both a `package.json` and a `Dockerfile`, it is built as a **Node.js** project and the Dockerfile is ignored. The Dockerfile path is the escape hatch for stacks the builder doesn't detect natively.
24
+
> The order matters: if your repo has both a `package.json` and a `Dockerfile`, it is built as a **Node.js** project and the Dockerfile is ignored. The Dockerfile path is the escape hatch for stacks the buildpacks don't detect natively.
25
+
26
+
You can skip detection entirely and **force a buildpack** — `node`, `python`, or `docker` — with the `buildpack` field in `faable.json` or the `--buildpack` (`-b`) CLI flag:
27
+
28
+
```bash
29
+
faable deploy --buildpack docker
30
+
```
24
31
25
32
---
26
33
@@ -78,20 +85,22 @@ Next.js is the exception: it always runs as a server (`next start`), with a pers
78
85
79
86
## 🐍 Python Projects
80
87
81
-
Detected by `requirements.txt`, `pyproject.toml`, or `Pipfile`. Unlike Node, **dependencies install inside the image build** (`pip install -r requirements.txt`, `pip install .`, or `pipenv install`respectively).
88
+
Detected by `requirements.txt`, `pyproject.toml`, `Pipfile`, or `cerebrium.toml`. Unlike Node, **dependencies install inside the image build** (`pip install -r requirements.txt`, `pip install .`, `pipenv install`, or the pip table of `cerebrium.toml`respectively). With a `requirements.txt`, the manifest is copied into its own image layer before the install, so rebuilding after a source-only change reuses the cached dependency layer.
82
89
83
90
**Python version**, first match wins:
84
91
85
92
1.`runtime.txt` — e.g. `python-3.12.1`
86
93
2.`.python-version`
87
-
3.`requires-python` in `pyproject.toml`
88
-
4. Default: `3.11.3`
94
+
3. The manifest's own version (e.g. `python_version` in `cerebrium.toml`)
95
+
4.`requires-python` in `pyproject.toml`
96
+
5. Default: `3.11.3`
89
97
90
98
**Start command**, first match wins:
91
99
92
100
1.`startCommand` in `faable.json`
93
101
2. A `web:` line in a `Procfile`
94
-
3. Framework auto-detection:
102
+
3. A start command declared by the manifest (e.g. the Cerebrium `entrypoint`)
103
+
4. Framework auto-detection:
95
104
-**Django** (`manage.py` + a package with `wsgi.py`) → `gunicorn <pkg>.wsgi:application --bind 0.0.0.0:$PORT`
@@ -100,11 +109,21 @@ For FastAPI and Flask the builder finds your app module by checking, in order: `
100
109
101
110
If no framework is recognized and there's no `Procfile` or `startCommand`, the deploy fails and asks you to provide one.
102
111
112
+
### Cerebrium Projects
113
+
114
+
A repo shaped for [Cerebrium](https://www.cerebrium.ai) — a `cerebrium.toml` plus a Python entrypoint, no `requirements.txt` — deploys out of the box. Faable reads the `[cerebrium.dependencies.pip]` table (and `[cerebrium.dependencies.paths] pip` when present) to install dependencies, `python_version` from `[cerebrium.deployment]`, and the `[cerebrium.runtime.custom] entrypoint` as the start command when set. `apt` and `conda` tables are not installed. If your repo also has a classic manifest, the classic manifest wins.
115
+
116
+
Because Faable runs **web services**, your project still needs a web entrypoint (a FastAPI/Flask app, a `Procfile`, or `startCommand` in `faable.json`) — a bare GPU function without one fails with an explanation.
117
+
118
+
### Python Without a Manifest
119
+
120
+
A lone `main.py` / `app.py` / `wsgi.py` with no dependency manifest at all is picked up by the Python fallback: the app builds **without installing any dependencies** (the deploy logs warn loudly). Framework detection still works by reading the entrypoint file itself, and `uvicorn`/`gunicorn` are added when the start command needs them. If your app imports anything beyond the standard library, add a `requirements.txt`. Note this fallback loses against a `Dockerfile` — an explicit Dockerfile always wins over a loose `.py` file.
121
+
103
122
---
104
123
105
124
## 🐳 Dockerfile Projects
106
125
107
-
No `package.json`, no Python manifests, but a `Dockerfile`? The builder runs `docker build .` on it **verbatim** — you control everything. Just honor the port contract below.
126
+
No `package.json`, no Python manifests, but a `Dockerfile`? The buildpack runs `docker build` on it **verbatim**(targeting `linux/amd64`, so images built on Apple Silicon run on the platform) — you control everything. Just honor the port contract below. If a `package.json` with a `next` dependency sits beside the Dockerfile (reachable by forcing `--buildpack docker`), the deploy is registered as a Next.js app so the platform provisions its build cache.
108
127
109
128
---
110
129
@@ -128,6 +147,7 @@ The platform also injects `FAABLE_HOST` (your app's public URL). `PORT` and `FAA
128
147
{
129
148
"app_id": "app_xxx",
130
149
"app_slug": "my-app",
150
+
"buildpack": "docker",
131
151
"buildCommand": "npm run build:prod",
132
152
"startCommand": "node dist/main.js"
133
153
}
@@ -136,6 +156,7 @@ The platform also injects `FAABLE_HOST` (your app's public URL). `PORT` and `FAA
|`app_id` / `app_slug`| Which Faable app this repo deploys to (written by `faable link`). |
159
+
|`buildpack`| Force a buildpack (`node`, `python`, `docker`) instead of auto-detection. The `--buildpack` CLI flag beats it. |
139
160
|`buildCommand`| Build step to run when `package.json` has no `build` script (Node), or custom install command (Python). |
140
161
|`startCommand`| Overrides everything — framework detection and `npm run start`. |
141
162
@@ -149,7 +170,11 @@ The Node image copies your working directory as-is and never runs `npm install`.
149
170
150
171
### I have a Dockerfile but Faable ignores it — why?
151
172
152
-
Because there's also a `package.json` (or Python manifest) at the root, which takes precedence. Remove it from the root, or embrace the zero-config Node/Python pipeline.
173
+
Because there's also a `package.json` (or Python manifest) at the root, which takes precedence. Force it with `--buildpack docker` (or `"buildpack": "docker"` in `faable.json`), remove the manifest from the root, or embrace the zero-config Node/Python buildpacks.
174
+
175
+
### My repo was made for another platform (Cerebrium, Replicate, Fly…) — will it deploy?
176
+
177
+
Cerebrium projects deploy natively (see above). For other platforms, the detection error names the config file it recognized (`cog.yaml`, `fly.toml`, `render.yaml`…) — Faable can't consume those directly; add one of the supported manifests or a `Dockerfile`.
0 commit comments