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

Docker: Disable chown in entrypoint script #1000

Closed
alex-phillips opened this issue Feb 4, 2021 · 5 comments
Closed

Docker: Disable chown in entrypoint script #1000

alex-phillips opened this issue Feb 4, 2021 · 5 comments
Labels
idea Feedback wanted / feature request released Available in the stable release

Comments

@alex-phillips
Copy link

After indexing my entire library, the docker container takes an enormous amount of time to startup related to the chown command that is part of the startup process. Because my library is large, this is taking forever due to all of the cache and sidecar files. These files, however, I doubt ever change ownership. Can this be disabled? Or can we incorporate a flag to manually disable this step?

@lastzero
Copy link
Member

lastzero commented Feb 4, 2021

Sure, this should only happen if you set / change the UID and/or GUI using environment variables:

https://github.com/photoprism/photoprism/blob/develop/docker/entrypoint.sh

You may set the user and group directly via Docker without using the environment variables. In addition, we may add yet another environment flag to disable chown.

@lastzero lastzero added the idea Feedback wanted / feature request label Feb 4, 2021
@alex-phillips
Copy link
Author

@lastzero I am setting the UID / GID via environment variables since other containers / applications touch these file as well. It is read-only though, so is that necessary as long as global has read access on the files? If that's the case, I can remove the env variables and no longer have this issue.

@lastzero
Copy link
Member

lastzero commented Feb 4, 2021

You may set a user in docker-compose.yml as well, so you don't even need global read permissions:

https://docs.docker.com/compose/compose-file/compose-file-v3/#domainname-hostname-ipc-mac_address-privileged-read_only-shm_size-stdin_open-tty-user-working_dir

@lastzero
Copy link
Member

lastzero commented Feb 4, 2021

We might be able to limit chmod to the storage path if that helps? My fear is that people set a new user and don't know how to change permissions accordingly.

@lastzero lastzero added the please-test Ready for acceptance test label Feb 5, 2021
lastzero added a commit that referenced this issue Feb 5, 2021
Uploads might not work otherwise.
@lastzero
Copy link
Member

lastzero commented Feb 5, 2021

@alex-phillips Let us know if this works for you 👍

@lastzero lastzero changed the title Docker startup chown Docker: Disable chown in entrypoint script Feb 5, 2021
@graciousgrey graciousgrey added released Available in the stable release and removed please-test Ready for acceptance test labels Feb 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
idea Feedback wanted / feature request released Available in the stable release
Projects
Status: Released 🌈
Development

No branches or pull requests

3 participants