diff --git a/docs/deployment/docker.md b/docs/deployment/docker.md index 1cd351c2bc..04a509d316 100644 --- a/docs/deployment/docker.md +++ b/docs/deployment/docker.md @@ -69,6 +69,10 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ # From here on we use the least-privileged `node` user to run the backend. USER node + +# This should create the app dir as `node`. +# If it is instead created as `root` then the `tar` command below will fail: `can't create directory 'packages/': Permission denied`. +# If this occurs, then ensure BuildKit is enabled (`DOCKER_BUILDKIT=1`) so the app dir is correctly created as `node`. WORKDIR /app # This switches many Node.js dependencies to production mode. @@ -206,6 +210,10 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ # From here on we use the least-privileged `node` user to run the backend. USER node + +# This should create the app dir as `node`. +# If it is instead created as `root` then the `tar` command below will fail: `can't create directory 'packages/': Permission denied`. +# If this occurs, then ensure BuildKit is enabled (`DOCKER_BUILDKIT=1`) so the app dir is correctly created as `node`. WORKDIR /app # Copy the install dependencies from the build stage and context diff --git a/packages/create-app/templates/default-app/packages/backend/Dockerfile b/packages/create-app/templates/default-app/packages/backend/Dockerfile index 3e9ca5ba48..f0be3ac1d3 100644 --- a/packages/create-app/templates/default-app/packages/backend/Dockerfile +++ b/packages/create-app/templates/default-app/packages/backend/Dockerfile @@ -21,6 +21,10 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ # From here on we use the least-privileged `node` user to run the backend. USER node + +# This should create the app dir as `node`. +# If it is instead created as `root` then the `tar` command below will fail: `can't create directory 'packages/': Permission denied`. +# If this occurs, then ensure BuildKit is enabled (`DOCKER_BUILDKIT=1`) so the app dir is correctly created as `node`. WORKDIR /app # This switches many Node.js dependencies to production mode.