Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ docker compose up -d
**Initialize backend**

```bash
sudo chmod 777 -R ./data/
cd backend/
./push.sh
./seed.sh
Expand Down
4 changes: 2 additions & 2 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -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 .
Expand All @@ -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
COPY --from=third-party-ext /extensions/directus ./extensions
12 changes: 6 additions & 6 deletions backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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 \
Expand Down Expand Up @@ -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.
3 changes: 3 additions & 0 deletions backend/directus-sync.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"dumpPath": "./directus-config/development"
}
7 changes: 5 additions & 2 deletions cypress/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.)
12 changes: 12 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -41,6 +51,8 @@ services:
condition: service_healthy
cache:
condition: service_healthy
init-uploads:
condition: service_completed_successfully
ports:
- 8055:8055
volumes:
Expand Down
Loading