From b10d15b5ecc461ea868bad3dc7fe2b2143d194d9 Mon Sep 17 00:00:00 2001 From: jbpenrath Date: Wed, 24 Jun 2026 11:10:29 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7(compose)=20use=201000=20as=20gid?= =?UTF-8?q?=20for=20all=20platforms=20for=20frontend-dev=20service?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On Mac OS gid is 20 and on linux it is 1000. The frontend Dockerfile set node user and group as owner of project resources. But the frontend-dev service use the local user when the service is running. This scenario prevents vite to write within node_modules folder so the frontend application is broken. In order to make the service platform agnostic, we always use 1000 as gid. --- Makefile | 2 +- compose.yaml | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 01fd96bb..9fbb28c7 100644 --- a/Makefile +++ b/Makefile @@ -24,7 +24,7 @@ BLUE := \033[1;34m DOCKER_UID = $(shell id -u) DOCKER_GID = $(shell id -g) DOCKER_USER = $(DOCKER_UID):$(DOCKER_GID) -COMPOSE = DOCKER_USER=$(DOCKER_USER) docker compose +COMPOSE = DOCKER_USER=$(DOCKER_USER) DOCKER_UID=$(DOCKER_UID) docker compose COMPOSE_EXEC = $(COMPOSE) exec COMPOSE_EXEC_APP = $(COMPOSE_EXEC) backend-dev COMPOSE_RUN = $(COMPOSE) run --rm diff --git a/compose.yaml b/compose.yaml index c4b02a9b..9df33e2a 100644 --- a/compose.yaml +++ b/compose.yaml @@ -131,7 +131,11 @@ services: - /app/.venv frontend-dev: - user: "${DOCKER_USER:-1000}" + # Keep the host UID (file ownership on the bind-mounted sources) but force + # the GID to 1000, the `node` group that owns the image's group-writable + # node_modules. On macOS the host GID is 20 (staff), not 1000, so the + # default ${DOCKER_USER} would leave Vite unable to write node_modules/.vite + user: "${DOCKER_UID:-1000}:1000" build: context: src/frontend target: calendars-dev