briqbriq

Python app

Your Python code running as a service, from files or a GitHub repo: it installs requirements.txt and starts it. No image to build.

  • app
  • language

Guides: Run your own app, Run a GitHub repo

Run it

briq_run({
  recipe: "python",
  params: {
    "version": "3.12",
    "packages": [],
    "port": 8080,
    "env": {},
    "size": "small"
  },
  wait: true
})

Parameters

NameTypeOptionsDefault
versionenum3.12, 3.13, 3.14"3.12"
filesrecord{ "path": "content" | { base64 } }—
repoobject{ url, ref?, dir?, token? }—
packagesstring[]—[]
installstring——
buildstring——
startstring——
portnumber—8080
envrecord{ NAME: "value" | { secret, value? } }{}
sizeenumnano, small, medium, large"small"
diskGbnumber——

Outputs

Returned by briq_run once the stack is healthy. Hosts resolve inside your team network; secrets are generated per run.

APP_URL
http://app.<stack>.internal:8080

What it runs

BriqImagePortsSizeVolume
apppython:3.12-slim8080small—

When to use it

  • You wrote a small Flask, FastAPI or plain http.server app and want it running next to its database, with a URL, without building an image.
  • A script should run as a service: a webhook receiver, a scheduler, a bot.

Tips

  • Code in a repo: pass repo: { url: "github.com/owner/app" } instead of files. See Run a GitHub repo.
  • A bot or a scheduler that only makes outgoing calls is not seen as use, so it sleeps after its sleep window. Give it sleep: "never" (always on, Pro plan and above), or a window longer than the gap between its runs.
  • Pass the code as files: { "app.py": "…", "requirements.txt": "flask\npsycopg[binary]" }. Relative paths go under /app, the working directory. They are written before the app starts, and again whenever it starts over.
  • requirements.txt is installed at each start; packages: ["flask"] adds more without a file. The packages stay on the briq's disk, so after the first start the install is quick.
  • start is the command when it is not python app.py, e.g. "uvicorn main:app --host :: --port 8080".
  • Listen on :: and on $PORT (8080 by default): the private network is IPv6.
  • Wire a database with env: run the postgres recipe in the same stack first and pass its DATABASE_URL as a secret, { secret: "DATABASE_URL", value: "…" }.
  • Publish it as you run it: briq_run({ recipe: "python", params: { files }, expose: "private" }) returns URL ("public" instead of "private" for anyone).
  • If it exits before it answers, the run fails and the briq is in error; briq_logs shows the traceback. briq_destroy it, fix the files, and run again. If it exits later, the briq stops with the code in lastExit.
  • Step by step: Run your own app, with a database and a URL.

On this page

Free to try

Let your agent try it, on us.

Every new account starts with €10 of credits. No card.

Connect your agent

How can we help?

Message to the briq team
hello@briq.cloud