TrafeX / docker-php-nginx

Docker image with PHP-FPM 8.3 & Nginx 1.24 on Alpine Linux
https://hub.docker.com/r/trafex/php-nginx
MIT License
1.33k stars 721 forks source link

Cannot create folder in WORKDIR #132

Closed duongsieu closed 10 months ago

duongsieu commented 1 year ago

I can not run composer i or mkdir folder in docker container. It show message: permisson define. I change user to root then can create but php-fpm.sock error. Please help me

TrafeX commented 1 year ago

Hi @duongsieu,

You should be able to create folder in the /var/www/html folder since that folder is owned by the nobody user (as long as this folder isn't mounted to a different filesystem). You can also temporary switch to root and back to nobody after you have set the correct permissions, example;


FROM trafex/php-nginx

USER root

RUN mkdir /some/folder

USER nobody
TrafeX commented 10 months ago

I assume this issue is resolved. If not, please let me know!

sieu-duong commented 10 months ago

@TrafeX thanks your support. I resolved issue