A lightweight PHP service that turns a folder of ZIP files into a private Composer (Packagist-compatible) repository. Drop versioned ZIPs into a folder tree, point your composer.json at the server, and install private packages like any other dependency.
Storage is pluggable via Flysystem — use local disk or S3-compatible storage. All endpoints are protected by HTTP basic auth.
zips/vendor/package/1.0.0.zipcomposer.json inside each ZIP is the source of truth for metadatapackages.json index, and caches it| Method | Route | Purpose |
|---|---|---|
| GET | /packages.json | Composer repository index (cached) |
| GET | /dist/{vendor}/{package}/{version}.zip | Streams the ZIP |
| POST | /rebuild | Force cache rebuild; returns {packages, versions, skipped, duration_ms} |
# minimal — only AUTH_PASS is required
docker run -d -p 8080:8080 -e AUTH_PASS=secret tredmann/repahead
# production — set the public URL so dist links resolve correctly
docker run -d \
-p 8080:8080 \
-e AUTH_PASS=secret \
-e APP_BASE_URL=https://composer.your-domain.com \
-v /path/to/zips:/var/www/html/zips \
tredmann/repahead
Drop a ZIP and trigger a rebuild:
docker cp ./acme-billing-1.2.0.zip <container>:/var/www/html/zips/acme/billing/1.2.0.zip
curl -u ci:secret -X POST http://localhost:8080/rebuild
composer config repositories.private composer https://composer.your-domain.com
composer config http-basic.composer.your-domain.com ci <password>
composer require acme/billing:^1.0
| Variable | Default | Description |
|---|---|---|
AUTH_PASS | — | Required. HTTP basic auth password |
AUTH_USER | ci | HTTP basic auth username |
APP_BASE_URL | http://localhost:8080 | Public base URL; used in packages.json dist download links |
STORAGE_DSN | local:/var/www/html/zips | Storage backend — local:<path> or s3:<bucket>/<prefix> |
CACHE_DIR | /var/www/html/cache | Directory for the packages.json cache and hash files |
LISTING_TTL_SECONDS | 30 | Seconds before the storage listing cache expires; 0 = list on every request |
AWS_ACCESS_KEY_ID | — | S3 only — AWS access key ID |
AWS_SECRET_ACCESS_KEY | — | S3 only — AWS secret access key |
AWS_REGION | — | S3 only — AWS region, e.g. eu-central-1 |
SERVER_NAME | :8080 | Listen address and port (base image) |
AUTOMATIC_HTTPS | off | Auto-HTTPS via FrankenPHP/Caddy; keep off behind a reverse proxy (base image) |
PHP_OPCACHE_ENABLE | 1 | Enable PHP OPcache (base image) |
zips/
vendor/
package/
1.0.0.zip
1.1.0.zip
The folder path determines vendor/package; the filename determines the version. ZIPs that are corrupt, missing composer.json, or whose name field doesn't match the folder path are skipped and logged.
STORAGE_DSN=s3:my-bucket/composer/zips
AWS_ACCESS_KEY_ID=AKIA...
AWS_SECRET_ACCESS_KEY=...
AWS_REGION=eu-central-1
Minimum IAM permissions: s3:ListBucket + s3:GetObject. The service is read-only from S3 — upload ZIPs externally, then POST /rebuild.
Content type
Image
Digest
sha256:962272da6…
Size
84.8 MB
Last updated
3 days ago
docker pull tredmann/repahead