Skip to content

Deploying a Repman App

Introduction

Repman is an open-source Composer repository manager for PHP packages, enabling private mirrors and package distribution. Deploying Repman with a Dockerfile on Klutch.sh provides reproducible builds, managed secrets, and persistent storage—all configured from klutch.sh/app. This guide covers installation, Dockerfile setup, environment variables, storage, Nixpacks overrides, and sample checks.


Prerequisites

  • A Klutch.sh account (sign up)
  • A GitHub repository containing your Repman Dockerfile (GitHub is the only supported git source)
  • External PostgreSQL database
  • Optional SMTP credentials for notifications

For onboarding, see the Quick Start.


Architecture and ports

  • Repman serves HTTP on internal port 80 in the official image. Choose HTTP traffic and set the internal port to 80.
  • Persistent storage is required for package metadata and cache.

Repository layout

repman/
├── Dockerfile # Must be at repo root for auto-detection
└── README.md

Keep secrets out of Git; store them in Klutch.sh environment variables.


Installation (local) and starter commands

Build and run locally (ensure Postgres is reachable):

Terminal window
docker build -t repman-local .
docker run -p 8080:80 \
-e APP_ENV=prod \
-e DATABASE_URL=postgres://user:pass@localhost:5432/repman \
-e APP_SECRET=$(openssl rand -hex 32) \
repman-local

Dockerfile for Repman (production-ready)

Place this at the repo root; Klutch.sh auto-detects Dockerfiles.

FROM buddy/repman:latest
ENV APP_ENV=prod
ENV APP_SECRET=change-me
EXPOSE 80
CMD ["/entrypoint.sh"]

Notes:

  • Pin to a specific tag (e.g., buddy/repman:1.5.7) for stability.
  • /entrypoint.sh starts the PHP-FPM/Nginx stack on port 80 inside the container.

Environment variables (Klutch.sh)

Set these before deploying:

  • PORT=80
  • APP_ENV=prod
  • APP_SECRET=<secure-random-hex>
  • DATABASE_URL=postgres://<user>:<password>@<host>:5432/<db>
  • Optional SMTP: MAILER_DSN=smtp://user:pass@smtp-host:587

If deploying without the Dockerfile and relying on Nixpacks:

  • NIXPACKS_START_CMD=/entrypoint.sh

Attach persistent volumes

Add storage in Klutch.sh (path and size only):

  • /var/www/repman/var — cache and generated files.
  • /var/www/repman/packages — mirrored/private packages storage.

Ensure paths are writable inside the container.


Deploy Repman on Klutch.sh (Dockerfile workflow)

  1. Push your repository—with the Dockerfile at the root—to GitHub.
  2. Open klutch.sh/app, create a project, and add an app.
  3. Select HTTP traffic and set the internal port to 80.
  4. Add environment variables (database URL, app secret, and optional mail settings).
  5. Attach volumes at /var/www/repman/var and /var/www/repman/packages sized for your cache and packages.
  6. Deploy. Your app will be reachable at https://example-app.klutch.sh; complete Repman setup in the UI.

Sample checks

Landing page:

Terminal window
curl -I https://example-app.klutch.sh

If you expose a health endpoint (replace if different):

Terminal window
curl -I https://example-app.klutch.sh/health

Health checks and production tips

  • Add an HTTP readiness probe to / (or /health if configured).
  • Keep DB credentials, app secret, and SMTP settings in Klutch.sh secrets; rotate regularly.
  • Pin image versions and test upgrades in staging before production rollout.
  • Monitor volume usage on /var/www/repman/var and /var/www/repman/packages; resize proactively.
  • Back up Postgres and package storage regularly.

Repman on Klutch.sh delivers reproducible Docker builds, managed secrets, and persistent storage—without extra YAML or CI steps. Configure ports, env vars, and volumes, then launch your Composer repository.