Skip to content

Update 2.create-a-project.md #428

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Update 2.create-a-project.md #428

wants to merge 1 commit into from

Conversation

mihaon
Copy link

@mihaon mihaon commented Aug 10, 2025

The https://directus.io/docs/getting-started/create-a-project contains a docker-compose.yml which will cause a permissions error when trying to upload files via the admin panel just after first start. It happens because docker "bind mount" host directory (in contrast to named volumes) is not initialized with owner/permissions taken from inside the container directory.

But since from Docker Compose 2.30 it became possible to use a post-start hook to fix this problem - https://docs.docker.com/compose/how-tos/lifecycle/#post-start-hooks.

So quick fix for .yml might be:

services:
    directus:
        # ...
        volumes:
            - ./database:/directus/database
            - ./uploads:/directus/uploads
            - ./extensions:/directus/extensions
        post_start:
            - command: chown node:node /directus/database /directus/uploads /directus/extensions
              user: root
        # ...

P.S.: this can also be fixed by adding chown to the CMD in the Dockerfile (like postgres docker image does)

Fix owner/permissions problem
@mihaon mihaon requested a review from a team as a code owner August 10, 2025 14:32
Copy link

vercel bot commented Aug 10, 2025

@mihaon is attempting to deploy a commit to the Directus Team on Vercel.

A member of the Team first needs to authorize it.

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.

1 participant