Skip to main content
Docker is the simplest case: capy run is your entrypoint, and the runtime platform (whatever orchestrates the container) sets SECRETS_BLOB and PROJECT_KEY in the container’s env.

Dockerfile

Any language works - swap the base image and the CMD. Python: CMD ["python", "app.py"]. Go: CMD ["./my-binary"]. Ruby: CMD ["bundle", "exec", "rails", "server"]. The one constant is that capy has to be on PATH in the final image, so a base image without npm needs another way to install the CLI. Every container start makes one call to the Capy service for its half of the decryption key, so the container needs outbound HTTPS to https://api.capy.sc - set CAPY_API_URL to point it at a BYOC instance instead. If that call fails - no egress, or a revoked deploy token - capy run exits 1 and your app never starts. In this mode capy run also writes .capy/next-env.js into the working directory for Next.js build-time inlining; the write is best-effort, so a read-only filesystem just skips it.

Running

Run capy deploy and pick Docker to mint the pair. Capy opens a temporary page on 127.0.0.1 showing your SECRETS_BLOB and PROJECT_KEY alongside the instructions for that platform - press Ctrl+C in the terminal to close it, or leave it and it shuts down after five minutes. If it can’t open a browser, the CLI prints both values in the terminal instead.

docker-compose

Set SECRETS_BLOB and PROJECT_KEY in the compose host’s env (your shell, a .env file next to compose.yaml - not the Capy-managed .env inside the project).

Kubernetes

The container image’s ENTRYPOINT ["capy", "run", "--"] wraps your app; Kubernetes injects the two env vars from the Secret.

Image size

@capysc/cli is a small Node package - about 1.7 MB unpacked at v0.9.1, with five runtime dependencies - but it is not a standalone binary, so the final image still needs Node 18 or newer. In a multi-stage build, install it in the final stage only: it compiles nothing and needs no build tooling.

Revocation

capy deploy list prints this project’s deploy tokens with their id prefixes, status, and creation date; pass a prefix to capy deploy revoke <deployId>. Revocation is server-side, so the next container boot fails - capy run can no longer fetch the service key it needs. Containers that already started keep the values they decrypted at boot, so restart or redeploy them to cut them off. If the secret values themselves may be exposed, change them at their source and mint a new deploy token; see Deploying → Revocation.
Last modified on August 11, 2026