Skip to content

Commit

Permalink
Merge branch 'main' into all-contributors/add-hsellik
Browse files Browse the repository at this point in the history
  • Loading branch information
matteovivona authored Nov 29, 2024
2 parents 265cd96 + 184e008 commit 178d655
Show file tree
Hide file tree
Showing 11 changed files with 281 additions and 329 deletions.
37 changes: 0 additions & 37 deletions .github/workflows/fly-deploy.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20
20.18.1
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [2.2.8](https://github.com/ducktors/turborepo-remote-cache/compare/v2.2.7...v2.2.8) (2024-11-29)


### Bug Fixes

* update node on dockerfile ([a9dd8cb](https://github.com/ducktors/turborepo-remote-cache/commit/a9dd8cb0269c1e2f5f4dc689e214c3b1e0042fdb))

## [2.2.7](https://github.com/ducktors/turborepo-remote-cache/compare/v2.2.6...v2.2.7) (2024-11-27)


Expand Down
19 changes: 11 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=${TARGETPLATFORM} node:20.13.1-alpine3.18@sha256:53108f67824964a573ea435fed258f6cee4d88343e9859a99d356883e71b490c as build
FROM node:20.18.1-alpine3.19 AS build

# set app basepath
ENV HOME=/home/app
Expand All @@ -7,7 +7,7 @@ ENV HOME=/home/app
COPY package.json $HOME/node/
COPY pnpm-lock.yaml $HOME/node/

# change workgin dir and install deps in quiet mode
# change working dir and install deps
WORKDIR $HOME/node

# enable pnpm and install deps
Expand All @@ -26,18 +26,21 @@ RUN pnpm install --prod --frozen-lockfile --ignore-scripts
RUN rm -rf $PROJECT_WORKDIR/.pnpm-store

# start new image for lower size
FROM --platform=${TARGETPLATFORM} node:20.13.1-alpine3.18@sha256:53108f67824964a573ea435fed258f6cee4d88343e9859a99d356883e71b490c
FROM node:20.13.1-alpine3.19

# dumb-init registers signal handlers for every signal that can be caught
RUN apk update && apk add --no-cache dumb-init
# Update OpenSSL and install dumb-init
RUN apk update && \
apk upgrade openssl && \
apk add --no-cache dumb-init && \
rm -rf /var/cache/apk/*

# create use with no permissions
RUN addgroup -g 101 -S app && adduser -u 100 -S -G app -s /bin/false app
# create user with no permissions
RUN addgroup -g 101 app && adduser -u 100 -D -G app -s /bin/false app

# set app basepath
ENV HOME=/home/app

# copy production complied node app to the new image
# copy production compiled node app to the new image
COPY --chown=app:app --from=build $HOME/node/ $HOME/node/

# run app with low permissions level user
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

![remote_cache_1](https://user-images.githubusercontent.com/1620916/216358421-36a63b0e-d1f6-484f-a4ca-6a7119cc0816.jpg)

[![GitHub package.json version](https://img.shields.io/github/package-json/v/ducktors/turborepo-remote-cache)](https://github.com/ducktors/turborepo-remote-cache/releases) ![node:20.13.1](https://img.shields.io/badge/node-20.13.1-lightgreen) ![pnpm@9.14.2](https://img.shields.io/badge/pnpm-9.14.2-yellow) [![CI](https://github.com/ducktors/turborepo-remote-cache/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/ducktors/turborepo-remote-cache/actions/workflows/ci.yml) [![Test](https://github.com/ducktors/turborepo-remote-cache/actions/workflows/test.yaml/badge.svg)](https://github.com/ducktors/turborepo-remote-cache/actions/workflows/test.yaml) [![Release](https://github.com/ducktors/turborepo-remote-cache/actions/workflows/release.yml/badge.svg)](https://github.com/ducktors/turborepo-remote-cache/actions/workflows/release.yml) [![Docker](https://github.com/ducktors/turborepo-remote-cache/actions/workflows/docker.yml/badge.svg)](https://github.com/ducktors/turborepo-remote-cache/actions/workflows/docker.yml) [![Maintainability](https://api.codeclimate.com/v1/badges/bbb26ca5247dee70dde0/maintainability)](https://codeclimate.com/github/ducktors/turborepo-remote-cache/maintainability) [![Coverage Status](https://coveralls.io/repos/github/ducktors/turborepo-remote-cache/badge.svg?branch=main)](https://coveralls.io/github/ducktors/turborepo-remote-cache?branch=main) [![Docker Pulls](https://img.shields.io/docker/pulls/ducktors/turborepo-remote-cache?logo=docker)](https://hub.docker.com/r/ducktors/turborepo-remote-cache) [![npm](https://img.shields.io/npm/dt/turborepo-remote-cache)](https://www.npmjs.com/package/turborepo-remote-cache) [![semantic-release: angular](https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release) [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/ducktors/turborepo-remote-cache/badge)](https://securityscorecards.dev/viewer/?uri=github.com/ducktors/turborepo-remote-cache) <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![GitHub package.json version](https://img.shields.io/github/package-json/v/ducktors/turborepo-remote-cache)](https://github.com/ducktors/turborepo-remote-cache/releases) ![node:20.18.1](https://img.shields.io/badge/node-20.18.1-lightgreen) ![pnpm@9.14.2](https://img.shields.io/badge/pnpm-9.14.2-yellow) [![CI](https://github.com/ducktors/turborepo-remote-cache/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/ducktors/turborepo-remote-cache/actions/workflows/ci.yml) [![Test](https://github.com/ducktors/turborepo-remote-cache/actions/workflows/test.yaml/badge.svg)](https://github.com/ducktors/turborepo-remote-cache/actions/workflows/test.yaml) [![Release](https://github.com/ducktors/turborepo-remote-cache/actions/workflows/release.yml/badge.svg)](https://github.com/ducktors/turborepo-remote-cache/actions/workflows/release.yml) [![Docker](https://github.com/ducktors/turborepo-remote-cache/actions/workflows/docker.yml/badge.svg)](https://github.com/ducktors/turborepo-remote-cache/actions/workflows/docker.yml) [![Maintainability](https://api.codeclimate.com/v1/badges/bbb26ca5247dee70dde0/maintainability)](https://codeclimate.com/github/ducktors/turborepo-remote-cache/maintainability) [![Coverage Status](https://coveralls.io/repos/github/ducktors/turborepo-remote-cache/badge.svg?branch=main)](https://coveralls.io/github/ducktors/turborepo-remote-cache?branch=main) [![Docker Pulls](https://img.shields.io/docker/pulls/ducktors/turborepo-remote-cache?logo=docker)](https://hub.docker.com/r/ducktors/turborepo-remote-cache) [![npm](https://img.shields.io/npm/dt/turborepo-remote-cache)](https://www.npmjs.com/package/turborepo-remote-cache) [![semantic-release: angular](https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release) [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/ducktors/turborepo-remote-cache/badge)](https://securityscorecards.dev/viewer/?uri=github.com/ducktors/turborepo-remote-cache) <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-31-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->

Expand Down
15 changes: 11 additions & 4 deletions docs/custom-remote-caching.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ __Note: The token value must be the same as for your server's `TURBO_TOKEN` env


## Enable remote caching in Docker
To enable remote caching in Docker, you must pass `TURBO_TEAM` and `TURBO_TOKEN` inside Dockerfile as [build args](https://docs.docker.com/build/guide/build-args/) if you have *not* included them within `.turbo/config.json` or added them as parameters within `package.json` (see *Config file* above).
To enable remote caching in Docker, you must pass `TURBO_TEAM` inside Dockerfile as [build arg](https://docs.docker.com/build/guide/build-args/) and `TURBO_TOKEN` as [build secret](https://docs.docker.com/build/building/secrets/) if you have *not* included them within `.turbo/config.json` or added them as parameters within `package.json` (see *Config file* above).

For example:

Expand All @@ -77,13 +77,20 @@ COPY turbo.json ./
COPY .turbo/config.json ./.turbo/

RUN --mount=type=bind,source=.git,target=.git \
pnpm turbo build
--mount=type=secret,id=TURBO_TOKEN \
TURBO_TOKEN=$(cat /run/secrets/TURBO_TOKEN) pnpm turbo build
```

and build your Remote Cache Server with this command:
and build your image leveraging Remote Cache Server with this command:

```sh
docker buildx build --progress=plain --platform linux/amd64,linux/arm64 -f Dockerfile . --build-arg TURBO_TEAM="ducktors" --build-arg TURBO_TOKEN="myGeneratedToken" --no-cache
# TURBO_TOKEN is an env variable preferably set from CI secrets
docker buildx build --progress=plain \
--platform linux/amd64,linux/arm64 \
-f Dockerfile . \
--build-arg TURBO_TEAM="ducktors" \
--secret id=TURBO_TOKEN,env=TURBO_TOKEN \
--no-cache
```

## Local environment variables
Expand Down
30 changes: 0 additions & 30 deletions fly.toml

This file was deleted.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "turborepo-remote-cache",
"version": "2.2.7",
"version": "2.2.8",
"description": "Turborepo remote cache server",
"main": "./dist/app.js",
"type": "module",
Expand Down Expand Up @@ -64,19 +64,19 @@
},
"devDependencies": {
"@biomejs/biome": "1.2.2",
"@commitlint/cli": "^19.3.0",
"@commitlint/config-conventional": "^19.2.2",
"@commitlint/prompt": "^19.3.1",
"@commitlint/cli": "^19.6.0",
"@commitlint/config-conventional": "^19.6.0",
"@commitlint/prompt": "^19.6.0",
"@ducktors/tsconfig": "^1.0.0",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/commit-analyzer": "^13.0.0",
"@semantic-release/git": "^10.0.1",
"@semantic-release/github": "^10.0.6",
"@semantic-release/github": "^10.3.5",
"@semantic-release/npm": "^12.0.1",
"@semantic-release/release-notes-generator": "^14.0.0",
"@semantic-release/release-notes-generator": "^14.0.1",
"@types/node": "^20.6.3",
"c8": "^9.0.0",
"commitizen": "^4.3.0",
"commitizen": "^4.3.1",
"commitlint-config-cz": "^0.13.3",
"commitlint-plugin-function-rules": "^2.0.2",
"cz-conventional-changelog": "^3.3.0",
Expand Down
Loading

0 comments on commit 178d655

Please sign in to comment.