Skip to main content

Image

cpsl.Image defines the runtime environment for your app. If the app needs Python packages, system packages, or setup commands, this is where they go.

Worked example

This is a realistic app-level deployment config:
This is what makes Capsule feel like an application platform instead of a model wrapper: runtime dependencies, branding, storage, warm behavior, and pricing all live next to the app code.

Constructor

You can also build it up incrementally:

Methods

python_packages can be a list or a path to requirements.txt.

Theme

Configure app branding with app.theme(...). Most apps do not need a fully custom theme. A preset plus a few overrides is usually enough:

Presets

Built-in presets:
  • dark
  • light
  • midnight
  • warm

Common theme fields

FileSystem

Use cpsl.FileSystem("name") to mount named durable storage into the runtime:
The key is the mount path inside the runtime. The value is the named filesystem resource in the workspace. Once mounted, you can use it like a normal path:

Pricing

Capsule uses cents for pricing:
Valid pricing types:
  • one_time
  • monthly

Warm runtimes

This asks Capsule to keep the runtime warm for a short period after activity.

Secrets and filesystems

These are deployment config, not runtime afterthoughts:
That same app could also set a theme, pages, tasks, and integrations. There is no separate deployment manifest hiding elsewhere.

Class-based deploy config

For class-based apps, the deploy-specific knobs live on @app.cls(...) instead of the App(...) constructor:

See also