title: Permissions problem with my first Laravel dev environment with Docker
body: <p>I'm switching my development environments from virtual machines (with Vagrant and VirtualBox) to containers with Docker. I successfully set-up a simple dev environment for WordPress and now I'm trying to do the same for Laravel.
  I'm on Windows 10 Pro, using WSL2 (Ubuntu 20.04 installed).
  If I try to on on <code>localhost:8088</code> (where my local Laravel installation is exposed) I get:</p>
  <blockquote>
  <p><em>UnexpectedValueException</em>
  The stream or file &quot;/var/www/html/storage/logs/laravel.log&quot; could not be opened in append mode: failed to open stream: Permission denied</p>
  </blockquote>
  <p>This is my <code>docker-compose.yml</code> file:</p>
  <pre><code>version: '3.3'
  
  services:
      nginx:
          container_name: 'NGINX_Web_Server'
          image: nginx:stable-alpine
          depends_on:
              - php
              - mariadb
          ports: 
              - 8088:80
          volumes: 
              - ./root:/var/www/html
              - ./nginx/default.conf:/etc/nginx/conf.d/default.conf
  
      php:
          container_name: 'PHP-FPM_7.4'
          build:
              context: .
              dockerfile: Dockerfile
          volumes: 
              - ./root:/var/www/html
          ports: 
              - 9090:9000
  
      mariadb:
          container_name: 'MariaDB_SQL_Server'
          image: mariadb
          restart: unless-stopped
          tty: true
          volumes: 
              - ./mariadb_data:/var/lib/mysql
          environment: 
              MYSQL_ROOT_PASSWORD: root
              MYSQL_DATABASE: laravel
              MYSQL_USER: ll_user
              MYSQL_PASSWORD: ll_password
  </code></pre>
  <p>this is the <code>Dockerfile</code> indicated in <code>docker-compose.yml</code>:</p>
  <pre><code>FROM php:fpm-alpine3.12
  
  RUN docker-php-ext-install pdo pdo_mysql
  #RUN chown -R www-data:www-data /var/www
  </code></pre>
  <p>and the <code>default.conf</code> file for nginx:</p>
  <pre><code>server {
      listen 80;
      index index.php index.html;
      server_name localhost;
      error_log /var/log/nginx/error.log;
      access_log /var/log/nginx/access.log;
      root /var/www/html/public;
  
      location / {
          try_files $uri $uri/ /index.php?$query_string;
  
      }
  
      location ~ \.php$ {
          try_files $uri =404;
          fastcgi_split_path_info ^(.+\.php)(/.+)$;
          fastcgi_pass php:9000;
          fastcgi_index index.php;
          include fastcgi_params;
          fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
          fastcgi_param PATH_INFO $fastcgi_path_info;
      }
  }
  </code></pre>
  <p><strong>What's wrong?</strong></p>