Skip to content

fix(docker): let the node user create the turbo cache dir - #79

Merged
JOY (JOY) merged 1 commit into
devfrom
fix/docker-node-turbo-cache
Sep 18, 2026
Merged

JOY (JOY) merged 1 commit into
devfrom
fix/docker-node-turbo-cache

Conversation

@JOY

Copy link
Copy Markdown

What

PR #74's USER node switch crash-looped production on boot. Root cause verified on the server: WORKDIR creates /calcom itself as root-owned (the COPY --chown covers the contents, not the pre-existing directory), so turbo cannot create /calcom/.turbo and yarn start (turbo run start) exits with Permission denied.

Fix: pre-create /calcom/.turbo owned by node before switching to USER node.

Incident handling

Production cal.crove.com was rolled back to the previous image (docker tag swap on crove-server) and is stable. Once this merges and the image builds, it gets re-deployed and verified end-to-end.

Evidence

  • Rollback container: 0 restarts, running. Broken image logs show exactly failed to create directory /calcom/.turbo from turbo.
  • docker build --check clean.

🤖 Generated by ZCode

The USER node switch (PR #74) crash-looped production on boot: WORKDIR
creates /calcom as root-owned, so turbo could not create /calcom/.turbo
and 'yarn start' (turbo run start) exited with 'Permission denied'.
Pre-create the directory for the node user. Production was rolled back
to the previous image while this builds.
@coderabbitai

coderabbitai Bot commented Sep 18, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 0453b8b5-687e-48b7-911f-08d447ca37df

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request modifies the Dockerfile to pre-create the /calcom/.turbo directory and change its ownership to the node user, preventing permission issues at runtime. The reviewer suggested a more robust alternative: changing the ownership of the /calcom directory itself non-recursively, which allows the node user to dynamically create any necessary runtime cache directories.

Comment thread Dockerfile
Comment on lines +108 to +111
# WORKDIR created /calcom itself as root-owned, so the node user cannot create
# turbo's runtime cache dir there - `yarn start` (turbo run start) died with
# "failed to create directory /calcom/.turbo" and crash-looped the container.
RUN mkdir -p /calcom/.turbo && chown node:node /calcom/.turbo

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Instead of pre-creating specific directories like /calcom/.turbo, it is more robust and future-proof to change the ownership of the /calcom directory itself. Since WORKDIR creates /calcom as root-owned, changing its ownership non-recursively to node:node allows the node user to create any necessary runtime cache directories or files (including .turbo) dynamically at runtime without duplicating layers.

# WORKDIR created /calcom itself as root-owned, so the node user cannot write
# to it. Changing ownership of the directory itself (non-recursively) allows
# the node user to create runtime cache directories like .turbo.
RUN chown node:node /calcom

@JOY
JOY (JOY) merged commit 98be6ed into dev Sep 18, 2026
11 checks passed
@JOY
JOY (JOY) deleted the fix/docker-node-turbo-cache branch September 18, 2026 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant