Getting started
Pick how you want to run Cacheiro, then point Nx or Lerna at it.
1. Run the server
Docker (recommended)
Each store flavor has its own image on GHCR: cacheiro-instants-fs, -s3, -gcs, and -azure.
docker run -p 3000:3000 \
-e CACHEIRO_AUTH_TOKEN=my-secret-token \
-v $(pwd)/cache:/cache \
ghcr.io/rerodrigues/cacheiro-instants-fsCheck that it is up:
curl -i http://localhost:3000/health/health needs no auth and returns 200 OK.
For S3, GCS, and Azure examples, TLS, and the full list of environment variables, see Instants. Cloud store options are documented on each store page: S3, GCS, Azure.
From source
Clone the repository and start the reference runner with hot reload:
npm install
cd packages/cacheiro-runner
cp config/local.jsonc.example config/local.jsonc
npm run devSee Runner for configuration files, environment variables, PM2, and Docker builds.
As a library
Import the core package and wire in your own store, config loader, and hooks. See Core.
2. Point Nx or Lerna at it
Set two environment variables where your tasks run (your machine, CI, or both):
export NX_SELF_HOSTED_REMOTE_CACHE_SERVER="https://mycache.server"
export NX_SELF_HOSTED_REMOTE_CACHE_ACCESS_TOKEN="your-secure-token-here" # optional
lerna run build
# or
nx run-many -t buildThe access token is only needed when the server has auth.token set. Use a read-only token for untrusted CI such as pull request builds.
Next steps
- Architecture: how the packages fit together.
- Security: tokens, read-only access, and HTTPS.
- Packages: reference documentation for every package.