Sign inSign up

philiplehmann/nx-cache-server

By philiplehmann

Updated 5 days ago

A lightweight, high-performance Nx cache server.

Image
1

10K+

philiplehmann/nx-cache-server repository overview

Nx Cache Server

A lightweight, self-hosted Nx remote cache server with S3-compatible storage backend.

Quick Start

Create a config.yaml file:

port: 3000

buckets:
  - name: minio-bucket
    bucketName: nx-cache
    accessKeyId: minioadmin
    secretAccessKey: minioadmin
    region: us-east-1
    endpointUrl: http://localhost:9000
    forcePathStyle: true

serviceAccessTokens:
  - name: local-dev
    bucket: minio-bucket
    prefix: /local
    accessToken: your-secure-bearer-token

Run with Docker:

docker run -d \
  -p 3000:3000 \
  -v $(pwd)/config.yaml:/nx-cache-server/config.yaml:ro \
  philiplehmann/nx-cache-server:2.2.2

Or use Docker Compose:

version: '3.8'
services:
  nx-cache-server:
    image: philiplehmann/nx-cache-server:2.2.2
    ports:
      - "3000:3000"
    volumes:
      - ./config.yaml:/nx-cache-server/config.yaml:ro
    restart: unless-stopped

Using with Nx

Set environment variables:

export NX_SELF_HOSTED_REMOTE_CACHE_SERVER=http://localhost:3000
export NX_SELF_HOSTED_REMOTE_CACHE_ACCESS_TOKEN=your-bearer-token

See Nx Self-Hosted Caching Documentation for details.

Examples

For complete examples including MinIO, AWS S3, multiple buckets, and more, see:

Configuration

Buckets
FieldRequiredDescription
nameYesUnique identifier
bucketNameYesS3 bucket name
regionNoAWS region (auto-discovered if omitted)
accessKeyIdNoAWS access key (or use accessKeyIdEnv)
secretAccessKeyNoAWS secret key (or use secretAccessKeyEnv)
endpointUrlNoCustom S3 endpoint (for MinIO, etc.)
forcePathStyleNoRequired for MinIO (default: false)
timeoutNoS3 timeout in seconds (default: 30)
Service Access Tokens
FieldRequiredDescription
nameYesToken identifier
bucketYesReferences bucket name
prefixYesS3 key prefix (use "" for root)
accessTokenYes*Bearer token (or use accessTokenEnv)

*Either accessToken or accessTokenEnv required

Multi-Architecture

Supports linux/amd64 and linux/arm64.

Additional Resources

Tag summary

Content type

Image

Digest

sha256:1ed9924b4

Size

35.4 MB

Last updated

5 days ago

docker pull philiplehmann/nx-cache-server