pier_

Apps

Containers Pier builds or pulls, runs in microVMs, and fronts with an HTTPS hostname

pier.yaml
environments:
  prod:
    apps:
      - name: api
        build_context: ./api             # build ./api/Dockerfile
        env:
          DATABASE_URL: { from: postgres.main.url }
          API_KEY: { secret: true }
        targets:
          - name: primary
            plan: app-s
            replicas: 2
      - name: whoami
        targets:
          - name: primary
            image: traefik/whoami:v1.10.1   # pull as-is, no build
            port: 80
            plan: app-s
pier ls apps
output
                                                                                       
 NAME STATUS  REPLICAS AUTOSCALE IMAGE                                    PORT UPDATED 
                                                                                       
 api  running 1/1      -         zot.pier-registry.svc.cluster.local:5... 8080 45s ago 
                                                                                       

An app is a container image with an HTTP port. Pier either builds it from a build_context (a Dockerfile, or a detected language) or pulls a given image. Each of its targets runs in its own microVM with an HTTPS hostname; the environment's variables and links are injected as environment variables.

Configuration

KeyOnMeaning
build_contextappDirectory to build, relative to pier.yaml. Exclusive with targets[].image
templateappStart from a starter template (node_hono, python_fastapi, go_fiber, rust_axum, dockerfile_caddy)
envapp, targetVariables; a target's entry overrides the app's, which overrides the environment's — Environment variables
previewsappPreview targets per branch — Preview deployments
targets[].image, porttargetPull this image; port is required with image and defaults to 8080 for builds
targets[].plantargetSize — Plans
targets[].replicas / autoscaletargetFixed count, or min/max with triggers; exclusive
targets[].deploy.branchtargetBranch that deploys this target on push
targets[].dockerfiletargetDockerfile path for this target, relative to the build context
targets[].domainstargetCustom domains — Domains
targets[].volumestarget{ volume, mount_path } bindings — Volumes
targets[].primarytargetThe default target when several exist; otherwise the first listed

Commands

CommandDoes
pier add app, pier set app api, pier rm app apideclare, change, remove; --stage edits pier.yaml only
pier deploy apibuild (if build_context) and roll the target
pier info api, pier logs api, pier monitor api, pier eventsinspect; api/canary names another target
pier restart apiroll the running target with its current image
pier rollback api --to <id>run a previous deploy's image
pier add target api canary --branch main, pier promote api/canarymore targets; change the primary
pier ssh apia shell in a running instance
pier pause api, pier resume apistop and keep; start again

Behaviour

  • A roll starts the new instance and retires the old one once the new one is ready.
  • A change to plan, replicas or autoscale is applied immediately; a variable change is released by the next pier deploy without a build; a change to the source, image, port or dockerfile is a build and a roll.
  • autoscale: 0-N with idle_after scales to zero after that period without traffic; the next request starts an instance.
  • Logs and metrics are kept per target; pier logs api --since 24h, pier monitor api --range 7d.
  • A removed app keeps its deploy history and bound volumes in trash for 30 days.

Tasks

Deploy an app · Set environment variables · Scale an app · Roll back a deploy · Deploy from GitHub · Preview deployments · Add Postgres to an app

On this page