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