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: Launch the php image with a non root user #1847

Open
J3m5 opened this issue Mar 9, 2021 · 1 comment
Open

Docker: Launch the php image with a non root user #1847

J3m5 opened this issue Mar 9, 2021 · 1 comment

Comments

@J3m5
Copy link
Contributor

J3m5 commented Mar 9, 2021

API Platform version(s) affected: 2.6.3

Description
I tried to launch the php docker image with a non root user but I'm facing problems.
I added the instruction USER www-data at the end of the api-platform-php stage of the dockerfile, (this user is created in the original php-fpm-alpine image),
but then I get permission errors with the commands executed in the docker-entrypoint.sh file.

I tried to change the permissions of the php and composer bin, api/var files etc but it didn't works.

How to reproduce
Run docker-compose with the www-data user set in the dockerfile or in the php service of the docker-compose file.

Additional Context
Configuring and running the containers with a non root user is a requirement from our web host.
The images are meant to be running in a kubernetes environment hosted and managed by a certified health data host.

@J3m5
Copy link
Contributor Author

J3m5 commented Mar 22, 2021

I've managed to get it working, the whole stack is running with a non root user now.
I'll post our setup here soon.

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