Skip to content
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

Allow to set initial chown permissions to volume #999

Closed
shyim opened this issue Sep 28, 2024 · 1 comment
Closed

Allow to set initial chown permissions to volume #999

shyim opened this issue Sep 28, 2024 · 1 comment

Comments

@shyim
Copy link

shyim commented Sep 28, 2024

When you create a docker volume, only the root user can write into it.

It would be nice if we could set initial permissions for a docker volume.

That is what I typically do in my compose:

 init-perm:
        image: alpine
        volumes:
            - files:/var/www/html/files
            - theme:/var/www/html/public/theme
            - media:/var/www/html/public/media
            - thumbnail:/var/www/html/public/thumbnail
            - sitemap:/var/www/html/public/sitemap
        command: chown 82:82 /var/www/html/files /var/www/html/public/theme /var/www/html/public/media /var/www/html/public/thumbnail /var/www/html/public/sitemap

    init:
        image: local
        build:
            context: .
        env_file: .app.env
        entrypoint: /setup
        volumes:
            - files:/var/www/html/files
            - theme:/var/www/html/public/theme
            - media:/var/www/html/public/media
            - thumbnail:/var/www/html/public/thumbnail
            - sitemap:/var/www/html/public/sitemap
        depends_on:
            db:
                condition: service_started
            init-perm:
                condition: service_completed_successfully
@shyim
Copy link
Author

shyim commented Sep 28, 2024

whoopsiee #897

@shyim shyim closed this as not planned Won't fix, can't repro, duplicate, stale Sep 28, 2024
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

No branches or pull requests

1 participant