Files
pnpm/pnpr/docker/entrypoint.sh
Zoltan Kochan 82da8431c2 chore(pnpr): add Dockerfile, compose, and deployment guide
Adds container tooling for self-hosting pnpr:

- pnpr/Dockerfile: multi-stage build (context = monorepo root, since
  pnpr depends on pacquet-* workspace crates) producing a slim runtime
  image with a /-/ping HEALTHCHECK.
- pnpr/docker/entrypoint.sh: maps PNPR_* env vars to CLI flags so a PaaS
  can configure the server without editing files.
- pnpr/docker/config.yaml: production config that proxies npm and
  persists state under PNPR_STORAGE via ${VAR:-default} substitution.
- pnpr/docker-compose.yml: local/PaaS compose with a /data volume.
- pnpr/DEPLOY.md: deployment guide including a step-by-step Coolify walkthrough.
2026-06-05 20:26:02 +02:00

24 lines
710 B
Bash

#!/bin/sh
# Translate PNPR_* environment variables into pnpr CLI flags so the
# server can be configured entirely through a PaaS's env-var UI.
set -eu
set -- --listen "${PNPR_LISTEN:-0.0.0.0:4873}" --storage "${PNPR_STORAGE:-/data}"
if [ -n "${PNPR_CONFIG:-}" ]; then
set -- "$@" --config "$PNPR_CONFIG"
fi
# Required behind a reverse proxy: pnpr rewrites dist.tarball URLs in
# served packuments to this URL. Without it, clients receive links
# pointing at the container's bind address.
if [ -n "${PNPR_PUBLIC_URL:-}" ]; then
set -- "$@" --public-url "$PNPR_PUBLIC_URL"
fi
if [ -n "${PNPR_PACKUMENT_TTL_SECS:-}" ]; then
set -- "$@" --packument-ttl-secs "$PNPR_PACKUMENT_TTL_SECS"
fi
exec pnpr "$@"