Skip to content

Getting started ​

Pick how you want to run Cacheiro, then point Nx or Lerna at it.

1. Run the server ​

Each store flavor has its own image on GHCR: cacheiro-instants-fs, -s3, -gcs, and -azure.

sh
docker run -p 3000:3000 \
  -e CACHEIRO_AUTH_TOKEN=my-secret-token \
  -v $(pwd)/cache:/cache \
  ghcr.io/rerodrigues/cacheiro-instants-fs

Check that it is up:

sh
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:

sh
npm install
cd packages/cacheiro-runner
cp config/local.jsonc.example config/local.jsonc
npm run dev

See 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):

sh
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 build

The 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.

Crafted with 🤍 by a 🇧🇷 human in 🇩🇪, for the humans of the 🌐