title: Docker NGINX - PHP-FPM Cross Container Permissions?
body: <p>I'm setting up a wordpress stack and having cross file permissions.</p>
  
  <p>When using <code>docker-compose up</code> permissions seem not to be a problem but when using local docker swarm and using <code>docker stack deploy</code>, nginx gives me a <code>403</code> for file permission errors. When inspecting both the <code>nginx:alpine</code> container and the <code>wordpress:php7.1-fpm-alpine</code> container, i do indeed see that the containers each have different permission, on the nginx side it marks the files inside <code>var/www/html</code> as owned by user and group id <code>82</code> while on the php7.1 they are owned by <code>www-data</code>. </p>
  
  <p>How can I make sure permission is correct across containers? The files are being bind mounted from the host.</p>
  
  <p>```</p>
  
  <pre><code>version: '3'
  services:
    nginx:
      depends_on:
        - wordpress
      image: private/nginx
      build: 
        context: ./stack/nginx
      volumes:
        - "wordpress:/var/www/html"
      ports:
        - 80:80
    wordpress:
      depends_on:
        - mysql
      image: private/wordpress
      build: 
        context: ./stack/wordpress
      volumes:
        - "wordpress:/var/www/html"
      environment:
        WORDPRESS_DB_USER: wordpress
        WORDPRESS_DB_PASSWORD: password
    mysql:
      image: mariadb
      volumes:
        - "mysql:/var/lib/mysql"
      environment:
        MYSQL_ROOT_PASSWORD: password
        MYSQL_DATABASE: wordpress
        MYSQL_USER: wordpress
        MYSQL_PASSWORD: password
  volumes:
    wordpress:
      driver: local
      driver_opts:
          type: none
          o: bind
          device: "${PWD}/wordpress"
    mysql:
  </code></pre>
  
  <p>```</p>