From 33a38a7d8f5e69dae30dba8088caff939bec82f0 Mon Sep 17 00:00:00 2001 From: Anton Tranelis Date: Sat, 6 Jun 2026 23:28:04 +0200 Subject: [PATCH 1/4] chore(backend): fix Dockerfile casing and add trailing newline Resolves the 'FromAsCasing: as and FROM keywords casing do not match' buildkit warning and adds the missing newline at end of file. Co-Authored-By: Claude Opus 4.7 --- backend/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index cdcf9469..9c4ca14f 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,4 +1,4 @@ -FROM node:22.20.0-alpine as third-party-ext +FROM node:22.20.0-alpine AS third-party-ext RUN apk add python3 g++ make WORKDIR /extensions ADD extensions . @@ -9,4 +9,4 @@ RUN cd node_modules && find . -maxdepth 1 -type d -name "directus-extension-*" - FROM directus/directus:11.17.4 # Copy third party extensions -COPY --from=third-party-ext /extensions/directus ./extensions \ No newline at end of file +COPY --from=third-party-ext /extensions/directus ./extensions From 59c6a2842f5b1fbae05a91b8bcf85f0e6a6df975 Mon Sep 17 00:00:00 2001 From: Anton Tranelis Date: Sat, 6 Jun 2026 23:28:04 +0200 Subject: [PATCH 2/4] chore(backend): add directus-sync.config.json with dump path directus-sync looked for one of directus-sync.config.{js,cjs,json} on every run and warned 'No config file found'. Pinning dumpPath in a proper config file silences the warning and gives us a single place to hold the few defaults that don't belong in env vars. Co-Authored-By: Claude Opus 4.7 --- backend/directus-sync.config.json | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 backend/directus-sync.config.json diff --git a/backend/directus-sync.config.json b/backend/directus-sync.config.json new file mode 100644 index 00000000..c511b5f2 --- /dev/null +++ b/backend/directus-sync.config.json @@ -0,0 +1,3 @@ +{ + "dumpPath": "./directus-config/development" +} From 08499a03aa2a58f49d2db4beea281663e9c68c2b Mon Sep 17 00:00:00 2001 From: Anton Tranelis Date: Sat, 6 Jun 2026 23:28:04 +0200 Subject: [PATCH 3/4] chore(infra): auto-fix uploads permissions via init-uploads service A fresh checkout (or a 'sudo rm -rf data/' reset) hits an EACCES on /directus/uploads because the bind-mounted host directory is root-owned, while the Directus container runs as a non-root user. Add a one-shot 'init-uploads' service that runs before the backend and chmods ./data/uploads to 777, then make the backend depend on it via 'service_completed_successfully'. The matching 'sudo chmod 777 -R ./data/' step in the README is no longer needed. Co-Authored-By: Claude Opus 4.7 --- README.md | 1 - docker-compose.yml | 12 ++++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7a251ac2..3793c10d 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,6 @@ docker compose up -d **Initialize backend** ```bash -sudo chmod 777 -R ./data/ cd backend/ ./push.sh ./seed.sh diff --git a/docker-compose.yml b/docker-compose.yml index 51162bd6..603988a2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,6 +6,16 @@ services: volumes: - ./app/dist:/srv:ro + # One-shot helper that runs before the backend starts. + # Ensures ./data/uploads exists and is writeable by the Directus + # container (which runs as a non-root user). Without this, a fresh + # checkout fails on a permission-denied error. + init-uploads: + image: busybox + command: ["sh", "-c", "mkdir -p /uploads && chmod -R 777 /uploads"] + volumes: + - ./data/uploads:/uploads + database: image: postgis/postgis:13-master volumes: @@ -41,6 +51,8 @@ services: condition: service_healthy cache: condition: service_healthy + init-uploads: + condition: service_completed_successfully ports: - 8055:8055 volumes: From 91a9161964ebec67ea6958a3fc191be2747b8dd5 Mon Sep 17 00:00:00 2001 From: Anton Tranelis Date: Sun, 7 Jun 2026 00:20:07 +0200 Subject: [PATCH 4/4] docs: align README chmod and directus-sync references with new setup - backend/README.md: bump directus-sync CLI examples to @3.5.1 to match the version pinned in push/pull/seed.sh. - backend/README.md: narrow the 'Access Data on local drive' chmod hint to ./data/database only; ./data/uploads is now handled automatically by the init-uploads service. - cypress/README.md: same adjustment in the troubleshooting section. Co-Authored-By: Claude Opus 4.7 --- backend/README.md | 12 ++++++------ cypress/README.md | 7 +++++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/backend/README.md b/backend/README.md index ee2e97f1..770f2fb7 100644 --- a/backend/README.md +++ b/backend/README.md @@ -16,7 +16,7 @@ In order to pull data from your locally running backend (see [docker-compose](.. ``` -npx directus-sync pull \ +npx directus-sync@3.5.1 pull \ --dump-path ./directus-config/development \ --directus-url http://localhost:8055 \ --directus-email admin@it4c.dev \ @@ -29,7 +29,7 @@ You can run `./pull.sh` to run this command and modify it via `export PROJECT=.. To push local changes or to seed directus use the following command ``` -npx directus-sync push \ +npx directus-sync@3.5.1 push \ --dump-path ./directus-config/development \ --directus-url http://localhost:8055 \ --directus-email admin@it4c.dev \ @@ -73,11 +73,11 @@ echo "REASSIGN OWNED BY admin TO directus" | docker exec -i utopia-map-database- ## Access Data on local drive -In order to access the postgress data mounted to the local drive at `/data/database` you need to make it accessible (assuming you are not root): +In order to access the postgres data mounted to the local drive at `./data/database` you need to make it accessible (assuming you are not root): ``` -sudo chmod 777 -R ./data/ +sudo chmod -R 777 ./data/database ``` -This process is to be repeated whenever you restart the database docker container +This process is to be repeated whenever you restart the database docker container. -The same applies for the uploads and extension folder - ensure that the folder is writeable or file uploads will fail. +The `./data/uploads` folder is taken care of automatically by the `init-uploads` service in `docker-compose.yml`, which runs once before the backend starts and makes the directory writeable. No manual chmod needed. diff --git a/cypress/README.md b/cypress/README.md index a6d8478f..10bd63d7 100644 --- a/cypress/README.md +++ b/cypress/README.md @@ -163,7 +163,10 @@ docker compose down && docker compose up -d docker compose down && sudo rm -rf ./data/database && docker compose up -d ``` -**Permission denied on ./data** +**Permission denied on ./data/database** ```bash -sudo chmod 777 -R ./data +sudo chmod -R 777 ./data/database ``` + +(The `./data/uploads` directory is fixed automatically by the +`init-uploads` service in `docker-compose.yml`.)