potpie Docker & Self-Hosted Deployment

GitHub

Context Graph for AI Native SDLC

RAW Compose
1. Pull Image (DOCKERHUB) docker pull potpie-ai/potpie
2. Docker Run (1-Click Launch) docker run -d --name potpie -p 3010:3010 --restart always potpie-ai/potpie:latest
3. Podman Run podman run -d --name potpie -p 3010:3010 --restart always potpie-ai/potpie:latest
4. Skopeo Inspect (Zero-Pull Manifest) skopeo inspect docker://docker.io/potpie-ai/potpie:latest
5. ORAS Pull (OCI Artifact) oras pull potpie-ai/potpie:latest
6. Compose Deployment docker compose up -d
potpie/sandbox/scripts/daytona-overrides/docker-compose.override.yaml
Download .yml
# Layered on top of /Users/nandan/Desktop/Dev/daytona/docker/docker-compose.yaml
# by scripts/setup-daytona-local.sh.
#
# Two changes:
#   1. Move the Daytona dashboard host port from 3000 to ${DAYTONA_DASHBOARD_PORT}
#      (default 3010) so port 3000 is free for the potpie frontend dev server.
#      Inside the container the API still listens on 3000, so service-to-service
#      URLs (`http://api:3000/api`) are untouched.
#   2. Replace the dex config bind with our copy that whitelists the new
#      `http://localhost:${DAYTONA_DASHBOARD_PORT}` redirect URIs in the
#      daytona OIDC client. Without this, dashboard login fails with
#      `invalid_redirect_uri` after the port move.
#
# `!override` is required for both fields. Compose merges list fields by
# default (appending), which would leave the original `3000:3000` mapping live
# and the unwanted dex config still mounted.

services:
  api:
    ports: !override
      - "${DAYTONA_DASHBOARD_PORT:-3010}:3000"
    # The API container does string substitution into the dashboard's built JS
    # at startup using DASHBOARD_BASE_API_URL (replaces %DAYTONA_BASE_API_URL%
    # in main.ts) and emits dashboardUrl in /api/config from DASHBOARD_URL.
    # Both default to localhost:3000 in upstream โ€” point them at the host port
    # we exposed above, otherwise the dashboard at localhost:3010 will try to
    # call localhost:3000/api and fail with `TypeError: Failed to fetch`.
    environment:
      DASHBOARD_URL: http://localhost:${DAYTONA_DASHBOARD_PORT:-3010}/dashboard
      DASHBOARD_BASE_API_URL: http://localhost:${DAYTONA_DASHBOARD_PORT:-3010}
      # Local-dev permissiveness: the runner runs on the same Docker VM that
      # also hosts Postgres, Redis, MinIO, etc. Memory routinely sits in the
      # 80-90% range, which drags the runner's `availabilityScore` below the
      # upstream default threshold of 10 โ†’ sandbox creation fails with
      # `No available runners`. Lowering the threshold to 1 lets the runner
      # be picked even under memory pressure (the score is also used to rank
      # multiple runners โ€” single-runner local dev doesn't need the gate).
      # Bump RAM in Docker Desktop / Colima for the durable fix.
      RUNNER_AVAILABILITY_SCORE_THRESHOLD: "1"
      RUNNER_DECLARATIVE_BUILD_SCORE_THRESHOLD: "1"
      # Daytona's upstream compose hard-codes `proxy.localhost:4000` as the
      # toolbox/preview hostname, which is fine when consumers run inside the
      # daytona-network (where Docker DNS resolves it) but breaks our potpie
      # worker that runs on the macOS host. macOS's resolver doesn't map
      # `proxy.localhost` to 127.0.0.1, so SDK calls die with NameResolutionError.
      # Re-point the API at plain `localhost:4000` (the proxy is published on
      # the host at that port already) so URLs the API returns are reachable.
      # Sandbox preview URLs `<port>-<sandboxId>.localhost:4000` work too โ€”
      # macOS Sequoia resolves `*.localhost` via mDNS to 127.0.0.1.
      PROXY_DOMAIN: localhost:4000
      PROXY_TEMPLATE_URL: http://{{PORT}}-{{sandboxId}}.localhost:4000
    # Upstream's substitution only replaces the `%DAYTONA_BASE_API_URL%`
    # placeholder, but the dashboard is built with `VITE_API_URL=http://localhost:3000/api`
    # baked in via Vite โ€” that becomes a literal `BASE_PATH = "http://localhost:3000"`
    # in the OpenAPI client and is the actual URL the dashboard fetches from.
    # Re-write the literal in the bundled JS at startup before nest boots.
    # `$$` escapes the `$` so compose passes the variable through to the shell.
    entrypoint:
      - /bin/sh
      - -c
      - |
        target_url="$${DASHBOARD_BASE_API_URL:-http://localhost:3000}"
        if [ "$$target_url" != "http://localhost:3000" ]; then
          find /daytona/dist/apps/dashboard -type f -name '*.js' \
            -exec sed -i "s|http://localhost:3000|$$target_url|g" {} +
        fi
        exec node dist/apps/api/main.js

  dex:
    volumes: !override
      - ${POTPIE_SANDBOX_DIR:?set by setup-daytona-local.sh}/scripts/daytona-overrides/dex-config.yaml:/etc/dex/config.yaml
      - dex_db:/var/dex