Skip to content

Commit

Permalink
chore: added readme and updated docker builder
Browse files Browse the repository at this point in the history
  • Loading branch information
raine-works committed Aug 7, 2024
1 parent 81aad06 commit e896856
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 67 deletions.
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Turbo Cache Server

Turborepo remote cache server for docker. This server allows you to share a single Turborepo cache across your entire team, significantly speeding up your build times by avoiding redundant work.

## Features

- **Remote Caching**: Share cache across multiple machines.
- **Dockerized**: Easy to deploy and manage using Docker.

## Prerequisites

- Docker installed on your machine.

## Getting Started

- Pull the docker image.

```
docker pull ghcr.io/raine-works/turbo-cache-server:latest
```

- Start the container.

```
docker run -d \
-e TURBO_TOKEN='YOUR_CUSTOM_TOKEN' \
-e LOCAL_STORAGE_DIR='/tmp/turbo' \
-p 8000:8000 \
--name turbo-cache-server \
ghcr.io/raine-works/turbo-cache-server:latest
```
1 change: 0 additions & 1 deletion apps/server/.release-it.js

This file was deleted.

10 changes: 8 additions & 2 deletions apps/server/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,19 @@ VERSION=$(jq -r .version package.json)

cd ../../

if docker buildx ls | grep -q docker-container; then
echo "Using existing builder."
else
docker buildx create --name container --driver=docker-container
fi

docker buildx build \
-f apps/server/Dockerfile \
--platform linux/amd64 \
--platform linux/amd64,linux/arm64 \
-t ghcr.io/raine-works/turbo-cache-server:latest \
-t ghcr.io/raine-works/turbo-cache-server:${VERSION} \
--build-arg=PORT=8000 \
--build-arg=NODE_ENV=production \
--load \
--push \
--builder=container \
.
2 changes: 1 addition & 1 deletion apps/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "@turbo-cache/server",
"version": "0.0.0",
"private": true,
"type": "module",
"main": "src/index.ts",
"repository": {
"type": "git",
Expand All @@ -19,7 +20,6 @@
},
"devDependencies": {
"@turbo-cache/tsconfig": "workspace:*",
"@turbo-cache/release-it": "workspace:*",
"bun-types": "1.1.21"
},
"dependencies": {
Expand Down
Binary file modified bun.lockb
Binary file not shown.
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@
"scripts": {
"deploy": "turbo deploy",
"dev": "turbo dev",
"docker:auth": "echo $(gh auth token) | docker login ghcr.io -u $(gh api user | jq -r '.login') --password-stdin",
"docker:auth": "rm -rf ~/.docker && echo $(gh auth token) | docker login ghcr.io -u $(gh api user | jq -r '.login') --password-stdin",
"docker:build": "turbo docker:build",
"format": "prettier --write .",
"prepare": "husky",
"release": "turbo release --concurrency=1"
"prepare": "husky"
},
"peerDependencies": {
"typescript": "5.2.2"
Expand Down
18 changes: 0 additions & 18 deletions packages/release-it/package.json

This file was deleted.

36 changes: 0 additions & 36 deletions packages/release-it/src/index.js

This file was deleted.

2 changes: 1 addition & 1 deletion packages/tsconfig/base.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"lib": ["ESNext"],
"module": "esnext",
"target": "esnext",
"moduleResolution": "Node",
"moduleResolution": "Bundler",
"moduleDetection": "force",
"allowImportingTsExtensions": true,
"noEmit": true,
Expand Down
6 changes: 1 addition & 5 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
"persistent": true,
"cache": false
},
"docker:build": {},
"release": {
"dependsOn": ["^release"],
"outputLogs": "new-only"
}
"docker:build": {}
}
}

0 comments on commit e896856

Please sign in to comment.