fix(docker): grant write permissions for npm-global directory

Adds a `chown` command to the Dockerfile to grant the `node` user
write permissions to the `/usr/local/share/npm-global` directory.
This resolves an `EACCES` permission denied error during the `npm install -g`
step in the Docker build process.
This commit is contained in:
mkorwel
2025-10-23 13:51:45 -07:00
parent c9a3d28d99
commit 247ac33265
+3
View File
@@ -10,6 +10,9 @@ ARG CLI_PACKAGE_NAME
ENV NPM_CONFIG_PREFIX=/usr/local/share/npm-global
ENV PATH=$PATH:/usr/local/share/npm-global/bin
# Ensure the node user has permissions to write to the global npm directory
RUN mkdir -p /usr/local/share/npm-global && chown -R node:node /usr/local/share/npm-global
# Configure npm to use GitHub Packages
RUN --mount=type=secret,id=GITHUB_TOKEN \
echo "${NPM_REGISTRY_SCOPE}:registry=${NPM_REGISTRY_URL}" > /home/node/.npmrc && \