From 221aedc5f5f5570492c6e70f4a14962cffc062e2 Mon Sep 17 00:00:00 2001 From: Matthieu MOREL Date: Sat, 24 Aug 2024 08:10:52 +0000 Subject: [PATCH 1/2] chore: use corepack to install pnpm --- .github/workflows/lint.yml | 8 ++++++++ .hadolint.yaml | 2 ++ Dockerfile | 12 ++++++++++-- docker-compose.yml | 3 --- docker-entrypoint.sh | 3 --- 5 files changed, 20 insertions(+), 8 deletions(-) create mode 100644 .hadolint.yaml delete mode 100755 docker-entrypoint.sh diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 9cb58f0ea..bb8eeb578 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -12,6 +12,14 @@ permissions: contents: write jobs: + docker-lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + + - uses: hadolint/hadolint-action@54c9adbab1582c2ef04b2016b760714a4bfde3cf # v3.1.0 + with: + verbose: true lint: runs-on: ubuntu-latest steps: diff --git a/.hadolint.yaml b/.hadolint.yaml new file mode 100644 index 000000000..853c0983e --- /dev/null +++ b/.hadolint.yaml @@ -0,0 +1,2 @@ +ignored: + - DL3002 # TODO: Last USER should not be root \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 7bec3bd4b..ec4dc9329 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,2 +1,10 @@ -FROM node:20.12.2-alpine3.19 AS base -RUN wget -qO- https://get.pnpm.io/install.sh | ENV="$HOME/.shrc" SHELL="$(which sh)" sh - +FROM node:20.12.2-alpine3.19 + +USER 0:0 + +RUN corepack enable \ + && corepack enable pnpm + +ENV NODE_OPTIONS="--max_old_space_size=8192" + +EXPOSE 9000 3333 diff --git a/docker-compose.yml b/docker-compose.yml index 841f07ff9..5fa1ff04a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,9 +7,6 @@ services: tty: true working_dir: /mermaid mem_limit: '8G' - entrypoint: ./docker-entrypoint.sh - environment: - - NODE_OPTIONS=--max_old_space_size=8192 volumes: - ./:/mermaid - root_cache:/root/.cache diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh deleted file mode 100755 index c222b7fd5..000000000 --- a/docker-entrypoint.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -source /root/.shrc -exec "$@" From ed352debd58cb42fee75334d67c10ea0bd97db30 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Sat, 24 Aug 2024 11:42:16 +0000 Subject: [PATCH 2/2] [autofix.ci] apply automated fixes --- .hadolint.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.hadolint.yaml b/.hadolint.yaml index 853c0983e..280ff9592 100644 --- a/.hadolint.yaml +++ b/.hadolint.yaml @@ -1,2 +1,2 @@ ignored: - - DL3002 # TODO: Last USER should not be root \ No newline at end of file + - DL3002 # TODO: Last USER should not be root