title: In docker-compose. How to set a volume for other user than root?
body: <p>I have this docker-compose.yml:</p>
  
  <pre><code>version: '2'
  
  services:
    httpd:
       build: ./etc/httpd/
       restart: always
       ports:
         - 8080:80
       volumes:
         - ./www:/var/www/html
       links:
         - maria_db
  
    maria_db:
      image: mariadb
      restart: always
      environment:
        MYSQL_ROOT_PASSWORD: root
      ports:
        - 3306:3306
      volumes:
        - db_data:/var/lib/mysql
  
  volumes:
    db_data:
      driver: local
  </code></pre>
  
  <p>And this ./etc/php/Dockerfile</p>
  
  <pre><code>FROM php:7.0-apache
  
  RUN a2enmod rewrite
  </code></pre>
  
  <p>And when it is run:
  $ docker-compose up --build -d</p>
  
  <p>The directory that bind the the volume is only for root:</p>
  
  <pre><code>$ ls -la
  total 20
  drwxr-xr-x  4 md   md   4096 feb 12 02:42 .
  drwxr-xr-x 14 md   md   4096 feb 11 03:01 ..
  -rw-r--r--  1 md   md    395 feb 12 02:39 docker-compose.yml
  drwxr-xr-x  3 md   md   4096 feb 12 01:55 etc
  drwxr-xr-x  2 root root 4096 feb 12 02:42 www
  </code></pre>
  
  <p>I have tried to create before the directory and other things...but not.</p>