Skip to content

docs: run docker compose exec as the app user #2058 - #308

Closed
Evgeniy-DB wants to merge 1 commit into
developfrom
fix/2058-fix-docker-app-access
Closed

Evgeniy-DB wants to merge 1 commit into
developfrom
fix/2058-fix-docker-app-access

Conversation

@Evgeniy-DB

@Evgeniy-DB Evgeniy-DB commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

docker compose exec bypasses bin/docker-entrypoint and runs as the image user, which is root: the entrypoint needs root to align the app uid with the bind-mount owner, chown the cache volumes and open up the Docker socket before dropping to app with su-exec. On Linux the .:/app bind-mount keeps real uids, so every command run this way — including the make check_all the docs prescribe — leaves root-owned files in tmp/ and log/ (bootsnap cache, vite test build, the test lock). The dev processes, running as app, then hit EACCES on them. The usual workaround, sudo rm -rf tmp/, also deletes the tracked tmp/pids/.keep, and Puma, which writes its pidfile without creating the directory, crashes on the next make up with ENOENT: tmp/pids/mcp.pid.
macOS is unaffected (Docker Desktop does not propagate ownership), and -u app works there too.
Existing Linux checkouts with root-owned files need a one-time sudo chown -R "$(id -u):$(id -g)" tmp log storage.

Related issues

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Refactor / chore
  • Breaking change

How was this tested?

Checklist

  • I read CONTRIBUTING.md.
  • All my commits are signed off for the DCO (git commit -s).
  • I have signed (or will sign) the CLA when the bot prompts me — or my
    organization has executed the Corporate CLA.
  • make check_all passes locally (tests, rubocop, brakeman, eslint, typescript).
  • I added/updated tests where it makes sense.
  • I updated documentation where it makes sense.
  • My commits use clear, descriptive messages.

`docker compose exec` bypasses bin/docker-entrypoint and runs as the
image user, which is root: the entrypoint needs root to align the app
uid with the bind-mount owner, chown the cache volumes and open up the
Docker socket before dropping to `app` with su-exec.
On Linux the `.:/app` bind-mount keeps real uids, so every command run
this way — including the `make check_all` the docs prescribe — leaves
root-owned files in tmp/ and log/ (bootsnap cache, vite test build,
the test lock). The dev processes, running as `app`, then hit EACCES
on them. The usual workaround, `sudo rm -rf tmp/`, also deletes the
tracked tmp/pids/.keep, and Puma, which writes its pidfile without
creating the directory, crashes on the next `make up` with
`ENOENT: tmp/pids/mcp.pid`.
macOS is unaffected (Docker Desktop does not propagate ownership), and
`-u app` works there too.
Existing Linux checkouts with root-owned files need a one-time
`sudo chown -R "$(id -u):$(id -g)" tmp log storage`.

Signed-off-by: Evgeniy Yagnenkov <[email protected]>
artempartos added a commit that referenced this pull request Sep 24, 2026
* fix(docker): run the dev stack as the host user instead of root

`docker compose exec` bypasses the entrypoint and ran as root, the image
user. On Linux that left root-owned files in tmp/ and log/, the app user
hit EACCES on them, and the `sudo rm -rf tmp` workaround deleted
tmp/pids/.keep, so Puma crashed on its pidfile (#298, #308).

web and worker now run as UID:GID, which the Makefile exports, so every
process, including exec, writes files the host user owns. The caches move
from named volumes, which are created root-owned, to bind-mounted
.docker-cache/ directories. The entrypoint's root section (uid remap,
chown, socket chgrp) is gone; worker reaches the Docker socket through
group_add. CI and production keep bin/run-as-app unchanged in behaviour.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Signed-off-by: Artem Petrov <[email protected]>

* fix(vite): keep tsconfig-paths out of the dev gem cache

The plugin crawls the whole checkout for tsconfig files. With the gems now
installed under .docker-cache/, it parsed a generator template shipped by
inertia_rails and logged a parse error on every build.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Signed-off-by: Artem Petrov <[email protected]>

---------

Signed-off-by: Artem Petrov <[email protected]>
Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
aixle-com Bot pushed a commit that referenced this pull request Nov 30, 2026
aixle-com Bot pushed a commit that referenced this pull request Nov 30, 2026
aixle-com Bot pushed a commit that referenced this pull request Nov 30, 2026
* docs(runners): design the layers and the adapter boundary (#308)

Signed-off-by: Alex <[email protected]>

* docs(runners): group the core by area, specify transactions and IO, lay out the Coder services (#308)

Signed-off-by: Alex <[email protected]>

* docs(runners): bring the layers design in line with the reworked 17c code (#308)

Signed-off-by: Alex <[email protected]>

---------

Signed-off-by: Alex <[email protected]>
Co-authored-by: Alex <[email protected]>
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.

2 participants