nanoninja / docker-nginx-php-mysql

Docker running Nginx, PHP-FPM, MySQL & PHPMyAdmin
1.76k stars 867 forks source link

Write permissions for docker process on "web" directory? #13

Open thisbesonic opened 6 years ago

thisbesonic commented 6 years ago

Hi!

Awesome project! I used vagrant and want to switch to docker. I will probably migrate many projects. First though I need to find out why docker-php can't write to the "web" folder.

Are there extra steps I need to do apart from your guide, or does the docker process need some special access rights? (I am on linux)

Thank you!

nanoninja commented 6 years ago

Hi @slottybon,

Thank you for appreciating the project.

In order for this to work I think I have to make my own image with Nginx because there are proprietary problems (www-data) in the file sharing between the host machine and the container at the writing level.

It is possible to fix the problem manually but it is not the best solution.

thisbesonic commented 6 years ago

Alright. I don't see myself fixing this, so for the time being I will stay with Vagrant. I will star your repo and wait for the issue to be fixed by you or docker folks though.

Jehong-Ahn commented 6 years ago

@slottybon, did you mean web/?

The root of the nginx project is web/public. https://github.com/nanoninja/docker-nginx-php-mysql/blob/master/etc/nginx/default.conf#L11

vnzhlv-zh commented 6 years ago

@toonitw is it not possible to change it? When I'm trying something like that: "/var/www/site.loc:/var/www/html" I get this error: "/var/www/html/public/index.php" is not found (2: No such file or directory),

Jehong-Ahn commented 6 years ago

@vanzhilov There are two ways.

  1. Move your app to site.loc/public
  2. Or modify nginx configuration as root /var/www/html https://github.com/nanoninja/docker-nginx-php-mysql/blob/master/etc/nginx/default.conf#L11