Skip to content

fix: preserve host ownership for learn-card-app docker dev#1130

Open
Computer8004 wants to merge 1 commit intolearningeconomy:mainfrom
Computer8004:fix/tay-193-docker-dist-ownership
Open

fix: preserve host ownership for learn-card-app docker dev#1130
Computer8004 wants to merge 1 commit intolearningeconomy:mainfrom
Computer8004:fix/tay-193-docker-dist-ownership

Conversation

@Computer8004
Copy link
Copy Markdown
Contributor

@Computer8004 Computer8004 commented Mar 27, 2026

Summary

  • run the learn-card-app app and watcher containers as the host uid/gid so package builds stop landing as root-owned files
  • route Docker compose launches through LOCAL_UID / LOCAL_GID in the learn-card-app dev scripts
  • make the image's internal Nx cache + run-command build output writable for that non-root runtime and replace the watcher cache volume with tmpfs mounts

Root cause

apps/learn-card-app/compose-local.yaml bind-mounts ../../packages into containers that were running as root. When Nx rebuilt workspace packages from Docker, it wrote dist outputs back to the host as root, which then broke local non-Docker builds.

Validation

  • LOCAL_UID=$(id -u) LOCAL_GID=$(id -g) docker compose -f compose-local.yaml run --rm --no-deps watcher id
  • LOCAL_UID=$(id -u) LOCAL_GID=$(id -g) docker compose -f compose-local.yaml run --rm --no-deps app id
  • LOCAL_UID=$(id -u) LOCAL_GID=$(id -g) docker compose -f compose-local.yaml run --rm --no-deps watcher pnpm exec nx show projects
  • LOCAL_UID=$(id -u) LOCAL_GID=$(id -g) docker compose -f compose-local.yaml run --rm --no-deps watcher pnpm exec nx run helpers:build
  • stat -c '%u:%g %n' packages/learn-card-helpers/dist

Related: TAY-193 / LC-1725

✨ PR Description

Purpose: Fix file ownership and permission issues in Docker development environment to prevent root-owned files on host system when running learn-card-app containers.

Main changes:

  • Configure containers to run as host user by setting LOCAL_UID/LOCAL_GID environment variables in user field
  • Replace persistent nx-cache volume with tmpfs mounts for cache directories to avoid permission conflicts
  • Add directory creation and permission setup in Dockerfile for cache and executor paths

Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using.
💡 Tip: You can customize your AI Description using Guidelines Learn how

@netlify
Copy link
Copy Markdown

netlify Bot commented Mar 27, 2026

‼️ Deploy request for staging-learncardapp rejected.

Name Link
🔨 Latest commit cc0bafe

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 27, 2026

⚠️ No Changeset found

Latest commit: cc0bafe

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@netlify
Copy link
Copy Markdown

netlify Bot commented Mar 27, 2026

Deploy Preview for learncarddocs canceled.

Name Link
🔨 Latest commit cc0bafe
🔍 Latest deploy log https://app.netlify.com/projects/learncarddocs/deploys/69c6f29693e9bb000937b415

@netlify
Copy link
Copy Markdown

netlify Bot commented Mar 27, 2026

Deploy Preview for app-store-1-basic-launchpad-app ready!

Name Link
🔨 Latest commit cc0bafe
🔍 Latest deploy log https://app.netlify.com/projects/app-store-1-basic-launchpad-app/deploys/69c6f29699eff20007eb47fe
😎 Deploy Preview https://deploy-preview-1130--app-store-1-basic-launchpad-app.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@gitstream-cm
Copy link
Copy Markdown
Contributor

gitstream-cm Bot commented Mar 27, 2026

This PR is missing a Jira ticket reference in the title or description.
Please add a Jira ticket reference to the title or description of this PR.

Copy link
Copy Markdown
Contributor

@gitstream-cm gitstream-cm Bot left a comment

Choose a reason for hiding this comment

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

✨ PR Review

LGTM

Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using.
💡 Tip: You can customize your AI Review using Guidelines Learn how

@gitstream-cm
Copy link
Copy Markdown
Contributor

gitstream-cm Bot commented Mar 27, 2026

🥷 Code experts: TaylorBeeston

TaylorBeeston has most 👩‍💻 activity in the files.
TaylorBeeston has most 🧠 knowledge in the files.

See details

Dockerfile.monorepo

Activity based on git-commit:

TaylorBeeston
MAR
FEB
JAN 103 additions & 0 deletions
DEC
NOV
OCT

Knowledge based on git-blame:
TaylorBeeston: 94%

apps/learn-card-app/compose-local.yaml

Activity based on git-commit:

TaylorBeeston
MAR 1 additions & 1 deletions
FEB 15 additions & 0 deletions
JAN 297 additions & 233 deletions
DEC 2 additions & 2 deletions
NOV 247 additions & 0 deletions
OCT

Knowledge based on git-blame:
TaylorBeeston: 76%

apps/learn-card-app/package.json

Activity based on git-commit:

TaylorBeeston
MAR
FEB 1 additions & 0 deletions
JAN
DEC 10 additions & 3 deletions
NOV 165 additions & 2 deletions
OCT

Knowledge based on git-blame:
TaylorBeeston: 66%

✨ Comment /gs review for LinearB AI review. Learn how to automate it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant