Skip to content

Commit

Permalink
fix: update node on dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
matteovivona committed Nov 28, 2024
1 parent 5a263a1 commit a9dd8cb
Show file tree
Hide file tree
Showing 5 changed files with 232 additions and 252 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20
20.18.1
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-30-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->

Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
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 a9dd8cb

Please sign in to comment.