wodby/docker4wordpress

MacOS permissions issue (-dev-macos is not working)

solosik opened this issue · 10 comments

Hello guys,

I've moved my project to a new MacOS machine and now it seems that I have a permissions issue.
I will be very appreciated for any help.

Thank you.

Issue Description

The whole wp-content/upload folder is not writable. This issue persists even with additional steps from your local development docs (I'm using -dev-macos PHP tag).

Please note also, that I'm using: docker4wordpress + wordpress-composer (WP 5.0.1) + docker-sync.

Debug Details

Codebase

mounted codebase

Host OS

macOS Mojave 10.14.2

PHP .env variables

### --- PHP ----

#PHP_TAG=7.2-dev-4.9.3
#PHP_TAG=7.1-dev-4.9.3
#PHP_TAG=5.6-dev-4.9.3
PHP_TAG=7.2-dev-macos-4.9.3
#PHP_TAG=7.1-dev-macos-4.9.3
#PHP_TAG=5.6-dev-macos-4.9.3

docker-sync.yml output

version: "2"

syncs:
  docker-sync:
    src: './'
    sync_userid: '501'
    sync_excludes: ['.gitignore', '.git/', '.idea/']
#  docker-sync-another-project:
#    src: '/absolute/path/to/project/codebase'
#    sync_userid: '1000'
#    sync_excludes: ['.gitignore', '.git/', '.idea/']

Docker info output

Containers: 8
 Running: 8
 Paused: 0
 Stopped: 0
Images: 8
Server Version: 18.09.0
Storage Driver: overlay2
 Backing Filesystem: extfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 468a545b9edcd5932818eb9de8e72413e616e86e
runc version: 69663f0bd4b60df09991c08812a60108003fa340
init version: fec3683
Security Options:
 seccomp
  Profile: default
Kernel Version: 4.9.125-linuxkit
Operating System: Docker for Mac
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 1.952GiB
Name: linuxkit-025000000001
ID: FRU6:JGTF:SGQ5:ISFG:6MBT:WFWB:MBDZ:YI3J:GT6V:GNJ3:I6ML:SVPN
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: 93
 Goroutines: 111
 System Time: 2018-12-14T16:49:33.661341175Z
 EventsListeners: 3
HTTP Proxy: gateway.docker.internal:3128
HTTPS Proxy: gateway.docker.internal:3129
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false
Product License: Community Engine 

Docker compose file

version: "3"

services:
   mariadb:
    image: wodby/mariadb:$MARIADB_TAG
    container_name: "${PROJECT_NAME}_mariadb"
    stop_grace_period: 30s
    environment:
      MYSQL_ROOT_PASSWORD: $DB_ROOT_PASSWORD
      MYSQL_DATABASE: $DB_NAME
      MYSQL_USER: $DB_USER
      MYSQL_PASSWORD: $DB_PASSWORD
    volumes:
#      - ./mariadb-init:/docker-entrypoint-initdb.d # Place init .sql file(s) here.
      - ./db-data:/var/lib/mysql # I want to manage volumes manually.

   php:
    image: wodby/wordpress-php:$PHP_TAG
    container_name: "${PROJECT_NAME}_php"
    environment:
      PHP_SENDMAIL_PATH: /usr/sbin/sendmail -t -i -S mailhog:1025
      DB_HOST: $DB_HOST
      DB_USER: $DB_USER
      DB_PASSWORD: $DB_PASSWORD
      DB_NAME: $DB_NAME
## Read instructions at https://wodby.com/stacks/wordpress/docs/local/xdebug/
#      PHP_XDEBUG: 1
#      PHP_XDEBUG_DEFAULT_ENABLE: 1
#      PHP_XDEBUG_REMOTE_CONNECT_BACK: 0
#      PHP_IDE_CONFIG: serverName=my-ide
#      PHP_XDEBUG_REMOTE_HOST: 172.17.0.1 # Linux
#      PHP_XDEBUG_REMOTE_HOST: 10.254.254.254 # macOS
#      PHP_XDEBUG_REMOTE_HOST: 10.0.75.1 # Windows
    volumes:
#      - ./:/var/www/html
## For macOS users (https://wodby.com/stacks/wordpress/docs/local/docker-for-mac/)
     # - ./:/var/www/html:cached # User-guided caching
      - docker-sync:/var/www/html # Docker-sync
## For XHProf and Xdebug profiler traces
#      - files:/mnt/files

   nginx:
    image: wodby/nginx:$NGINX_TAG
    container_name: "${PROJECT_NAME}_nginx"
    depends_on:
      - php
    environment:
#      NGINX_PAGESPEED: "on"
      NGINX_STATIC_OPEN_FILE_CACHE: "off"
      NGINX_ERROR_LOG_LEVEL: debug
      NGINX_BACKEND_HOST: php
      NGINX_VHOST_PRESET: wordpress
      NGINX_SERVER_ROOT: /var/www/html/web
    volumes:
#      - ./:/var/www/html
# Options for macOS users (https://wodby.com/stacks/wordpress/docs/local/docker-for-mac/)
     # - ./:/var/www/html:cached # User-guided caching
      - docker-sync:/var/www/html # Docker-sync
    labels:
      - 'traefik.backend=nginx'
      - 'traefik.port=80'
      - 'traefik.frontend.rule=Host:${PROJECT_BASE_URL}'

   mailhog:
    image: mailhog/mailhog
    container_name: "${PROJECT_NAME}_mailhog"
    labels:
      - 'traefik.backend=mailhog'
      - 'traefik.port=8025'
      - 'traefik.frontend.rule=Host:mailhog.${PROJECT_BASE_URL}'

#  postgres:
#    image: wodby/postgres:$POSTGRES_TAG
#    container_name: "${PROJECT_NAME}_postgres"
#    stop_grace_period: 30s
#    environment:
#      POSTGRES_PASSWORD: $DB_PASSWORD
#      POSTGRES_DB: $DB_NAME
#      POSTGRES_USER: $DB_USER
#    volumes:
#      - ./postgres-init:/docker-entrypoint-initdb.d # Place init file(s) here.
#      - /path/to/postgres/data/on/host:/var/lib/postgresql/data # I want to manage volumes manually.

#  apache:
#    image: wodby/apache:$APACHE_TAG
#    container_name: "${PROJECT_NAME}_apache"
#    depends_on:
#      - php
#    environment:
#      APACHE_LOG_LEVEL: debug
#      APACHE_BACKEND_HOST: php
#      APACHE_VHOST_PRESET: php
#    volumes:
#      - ./:/var/www/html
## For macOS users (https://wodby.com/stacks/wordpress/docs/local/docker-for-mac/)
##      - ./:/var/www/html:cached # User-guided caching
##      - docker-sync:/var/www/html # Docker-sync
#    labels:
#      - 'traefik.backend=apache'
#      - 'traefik.port=80'
#      - 'traefik.frontend.rule=Host:${PROJECT_BASE_URL}'

#  varnish:
#    image: wodby/varnish:$VARNISH_TAG
#    container_name: "${PROJECT_NAME}_varnish"
#    depends_on:
#      - nginx
#    environment:
#      VARNISH_SECRET: secret
#      VARNISH_BACKEND_HOST: nginx
#      VARNISH_BACKEND_PORT: 80
#      VARNISH_PURGE_KEY: key
#      VARNISH_CONFIG_PRESET: wordpress
#      VARNISH_PURGE_EXTERNAL_REQUEST_HEADER: X-Real-IP
#    labels:
#      - 'traefik.backend=varnish'
#      - 'traefik.port=6081'
#      - 'traefik.frontend.rule=Host:varnish.${PROJECT_BASE_URL}'

#  redis:
#    container_name: "${PROJECT_NAME}_redis"
#    image: wodby/redis:$REDIS_TAG

#  adminer:
#    container_name: "${PROJECT_NAME}_adminer"
#    image: wodby/adminer:$ADMINER_TAG
#    environment:
## For PostgreSQL:
##      ADMINER_DEFAULT_DB_DRIVER: pgsql
#      ADMINER_DEFAULT_DB_HOST: $DB_HOST
#      ADMINER_DEFAULT_DB_NAME: $DB_NAME
#    labels:
#      - 'traefik.backend=adminer'
#      - 'traefik.port=9000'
#      - 'traefik.frontend.rule=Host:adminer.${PROJECT_BASE_URL}'

#  webgrind:
#    image: wodby/webgrind:$WEBGRIND_TAG
#    container_name: "${PROJECT_NAME}_webgrind"
#    environment:
#      WEBGRIND_PROFILER_DIR: /mnt/files/xdebug/profiler
#    labels:
#      - 'traefik.backend=webgrind'
#      - 'traefik.port=8080'
#      - 'traefik.frontend.rule=Host:webgrind.${PROJECT_BASE_URL}'
#    volumes:
#      - files:/mnt/files

   pma:
    image: phpmyadmin/phpmyadmin
    container_name: "${PROJECT_NAME}_pma"
    environment:
      PMA_HOST: $DB_HOST
      PMA_USER: $DB_USER
      PMA_PASSWORD: $DB_PASSWORD
      PHP_UPLOAD_MAX_FILESIZE: 1G
      PHP_MAX_INPUT_VARS: 1G
    labels:
      - 'traefik.backend=pma'
      - 'traefik.port=80'
      - 'traefik.frontend.rule=Host:pma.${PROJECT_BASE_URL}'

#  athenapdf:
#    image: arachnysdocker/athenapdf-service:$ATHENAPDF_TAG
#    container_name: "${PROJECT_NAME}_athenapdf"
#    environment:
#      WEAVER_AUTH_KEY: weaver-auth-key
#      WEAVER_ATHENA_CMD: "athenapdf -S"
#      WEAVER_MAX_WORKERS: 10
#      WEAVER_MAX_CONVERSION_QUEUE: 50
#      WEAVER_WORKER_TIMEOUT: 90
#      WEAVER_CONVERSION_FALLBACK: "false"

#  blackfire:
#    image: blackfire/blackfire
#    container_name: "${PROJECT_NAME}_blackfire"
#    environment:
#      BLACKFIRE_SERVER_ID: XXXXX
#      BLACKFIRE_SERVER_TOKEN: YYYYY

#  solr:
#    image: wodby/solr:$SOLR_TAG
#    container_name: "${PROJECT_NAME}_solr"
#    environment:
#      SOLR_HEAP: 1024m
#    labels:
#      - 'traefik.backend=solr'
#      - 'traefik.port=8983'
#      - 'traefik.frontend.rule=Host:solr.${PROJECT_BASE_URL}'

#  elasticsearch:
#    image: wodby/elasticsearch:$ELASTICSEARCH_TAG
#    environment:
#      ES_JAVA_OPTS: "-Xms500m -Xmx500m"
#    ulimits:
#      memlock:
#        soft: -1
#        hard: -1

#  kibana:
#    image: wodby/kibana:$KIBANA_TAG
#    depends_on:
#      - elasticsearch
#    labels:
#      - 'traefik.backend=kibana'
#      - 'traefik.port=5601'
#      - 'traefik.frontend.rule=Host:kibana.php.docker.localhost'

#  node:
#    image: wodby/node:$NODE_TAG
#    container_name: "${PROJECT_NAME}_node"
#    working_dir: /app
#    labels:
#      - 'traefik.backend=node'
#      - 'traefik.port=3000'
#      - 'traefik.frontend.rule=Host:front.${PROJECT_BASE_URL}'
#    expose:
#      - "3000"
#    volumes:
#      - ./path/to/your/single-page-app:/app
#    command: sh -c 'npm install && npm run start'

#  memcached:
#    container_name: "${PROJECT_NAME}_memcached"
#    image: wodby/memcached:$MEMCACHED_TAG

#  opensmtpd:
#    container_name: "${PROJECT_NAME}_opensmtpd"
#    image: wodby/opensmtpd:$OPENSMTPD_TAG

#  rsyslog:
#    container_name: "${PROJECT_NAME}_rsyslog"
#    image: wodby/rsyslog:$RSYSLOG_TAG

#  xhprof:
#    image: wodby/xhprof:$XHPROF_TAG
#    restart: always
#    volumes:
#      - files:/mnt/files
#    labels:
#      - 'traefik.backend=xhprof'
#      - 'traefik.port=8080'
#      - 'traefik.frontend.rule=Host:xhprof.${PROJECT_BASE_URL}'

   portainer:
    image: portainer/portainer
    container_name: "${PROJECT_NAME}_portainer"
    command: --no-auth -H unix:///var/run/docker.sock
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    labels:
      - 'traefik.backend=portainer'
      - 'traefik.port=9000'
      - 'traefik.frontend.rule=Host:portainer.${PROJECT_BASE_URL}'

   traefik:
    image: traefik
    container_name: "${PROJECT_NAME}_traefik"
    command: -c /dev/null --web --docker --logLevel=INFO
    ports:
      - '8000:80'
#      - '8080:8080' # Dashboard
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock

volumes:
## Docker-sync for macOS users
  docker-sync:
    external: true
## For Xdebug profiler
#  files:

Logs output - php

topdiff_php  | [14-Dec-2018 16:42:29] NOTICE: fpm is running, pid 1
topdiff_php  | [14-Dec-2018 16:42:29] NOTICE: ready to handle connections
topdiff_php  | [14-Dec-2018 16:44:25] WARNING: [pool www] child 92 said into stderr: "NOTICE: PHP message: PHP Warning:  file_put_contents(/var/www/html/web/wp-content/uploads/cache/1c90c6f62738a1c4e06e5e79254a3b93fadb4109.php): failed to open stream: Permission denied in /var/www/html/web/wp-content/themes/topdifference/vendor/illuminate/filesystem/Filesystem.php on line 122"
topdiff_php  | [14-Dec-2018 16:44:25] WARNING: [pool www] child 92 said into stderr: "NOTICE: PHP message: PHP Warning:  include(/var/www/html/web/wp-content/uploads/cache/1c90c6f62738a1c4e06e5e79254a3b93fadb4109.php): failed to open stream: No such file or directory in /var/www/html/web/wp-content/themes/topdifference/vendor/illuminate/view/Engines/PhpEngine.php on line 43"
topdiff_php  | [14-Dec-2018 16:44:25] WARNING: [pool www] child 92 said into stderr: "NOTICE: PHP message: PHP Warning:  include(): Failed opening '/var/www/html/web/wp-content/uploads/cache/1c90c6f62738a1c4e06e5e79254a3b93fadb4109.php' for inclusion (include_path='.:/usr/local/lib/php') in /var/www/html/web/wp-content/themes/topdifference/vendor/illuminate/view/Engines/PhpEngine.php on line 43"
topdiff_php  | 172.18.0.8 -  14/Dec/2018:16:44:25 +0000 "GET /index.php" 200
topdiff_php  | [14-Dec-2018 16:44:27] WARNING: [pool www] child 93 said into stderr: "NOTICE: PHP message: PHP Warning:  file_put_contents(/var/www/html/web/wp-content/uploads/cache/1c90c6f62738a1c4e06e5e79254a3b93fadb4109.php): failed to open stream: Permission denied in /var/www/html/web/wp-content/themes/topdifference/vendor/illuminate/filesystem/Filesystem.php on line 122"
topdiff_php  | [14-Dec-2018 16:44:27] WARNING: [pool www] child 93 said into stderr: "NOTICE: PHP message: PHP Warning:  include(/var/www/html/web/wp-content/uploads/cache/1c90c6f62738a1c4e06e5e79254a3b93fadb4109.php): failed to open stream: No such file or directory in /var/www/html/web/wp-content/themes/topdifference/vendor/illuminate/view/Engines/PhpEngine.php on line 43"
topdiff_php  | [14-Dec-2018 16:44:27] WARNING: [pool www] child 93 said into stderr: "NOTICE: PHP message: PHP Warning:  include(): Failed opening '/var/www/html/web/wp-content/uploads/cache/1c90c6f62738a1c4e06e5e79254a3b93fadb4109.php' for inclusion (include_path='.:/usr/local/lib/php') in /var/www/html/web/wp-content/themes/topdifference/vendor/illuminate/view/Engines/PhpEngine.php on line 43"
topdiff_php  | 172.18.0.8 -  14/Dec/2018:16:44:27 +0000 "GET /index.php" 200
topdiff_php  | [14-Dec-2018 16:44:28] WARNING: [pool www] child 92 said into stderr: "NOTICE: PHP message: PHP Warning:  file_put_contents(/var/www/html/web/wp-content/uploads/cache/1c90c6f62738a1c4e06e5e79254a3b93fadb4109.php): failed to open stream: Permission denied in /var/www/html/web/wp-content/themes/topdifference/vendor/illuminate/filesystem/Filesystem.php on line 122"
topdiff_php  | [14-Dec-2018 16:44:28] WARNING: [pool www] child 92 said into stderr: "NOTICE: PHP message: PHP Warning:  include(/var/www/html/web/wp-content/uploads/cache/1c90c6f62738a1c4e06e5e79254a3b93fadb4109.php): failed to open stream: No such file or directory in /var/www/html/web/wp-content/themes/topdifference/vendor/illuminate/view/Engines/PhpEngine.php on line 43"
topdiff_php  | [14-Dec-2018 16:44:28] WARNING: [pool www] child 92 said into stderr: "NOTICE: PHP message: PHP Warning:  include(): Failed opening '/var/www/html/web/wp-content/uploads/cache/1c90c6f62738a1c4e06e5e79254a3b93fadb4109.php' for inclusion (include_path='.:/usr/local/lib/php') in /var/www/html/web/wp-content/themes/topdifference/vendor/illuminate/view/Engines/PhpEngine.php on line 43"
topdiff_php  | 172.18.0.8 -  14/Dec/2018:16:44:28 +0000 "GET /index.php" 200
topdiff_php  | 172.18.0.8 -  14/Dec/2018:16:44:30 +0000 "POST /wp-admin/admin-ajax.php" 200
topdiff_php  | 172.18.0.8 -  14/Dec/2018:16:44:35 +0000 "POST /wp-admin/async-upload.php" 200
topdiff_php  | 172.18.0.8 -  14/Dec/2018:16:45:30 +0000 "POST /wp-admin/admin-ajax.php" 200
topdiff_php  | 172.18.0.8 -  14/Dec/2018:16:46:30 +0000 "POST /wp-admin/admin-ajax.php" 200
topdiff_php  | 172.18.0.8 -  14/Dec/2018:16:48:32 +0000 "POST /wp-admin/admin-ajax.php" 200
topdiff_php  | 172.18.0.8 -  14/Dec/2018:16:49:32 +0000 "POST /wp-admin/admin-ajax.php" 200
topdiff_php  | 172.18.0.8 -  14/Dec/2018:16:50:32 +0000 "POST /wp-admin/admin-ajax.php" 200
topdiff_php  | 172.18.0.8 -  14/Dec/2018:16:51:32 +0000 "POST /wp-admin/admin-ajax.php" 200
topdiff_php  | 172.18.0.8 -  14/Dec/2018:16:52:32 +0000 "POST /wp-admin/admin-ajax.php" 200
topdiff_php  | 172.18.0.8 -  14/Dec/2018:16:53:32 +0000 "POST /wp-admin/admin-ajax.php" 200
topdiff_php  | 172.18.0.8 -  14/Dec/2018:16:55:42 +0000 "POST /wp-admin/admin-ajax.php" 200

Logs output - nginx

topdiff_nginx | 2018/12/14 16:42:29 [notice] 1#1: using the "epoll" event method
topdiff_nginx | 2018/12/14 16:42:29 [info] 1#1: [ngx_pagespeed 1.13.35.2-0] SharedMemCache: pagespeed_default_shm/metadata_cache, sectors = 128, entries/sector = 2226,  64-byte blocks/sector = 4452, total footprint: 52445184
topdiff_nginx | 2018/12/14 16:42:29 [info] 1#1: [ngx_pagespeed 1.13.35.2-0] Initializing shared memory for path: /var/cache/ngx_pagespeed/ flush .
topdiff_nginx | 2018/12/14 16:42:29 [notice] 1#1: nginx/1.15.6
topdiff_nginx | 2018/12/14 16:42:29 [notice] 1#1: built by gcc 6.4.0 (Alpine 6.4.0) 
topdiff_nginx | 2018/12/14 16:42:29 [notice] 1#1: OS: Linux 4.9.125-linuxkit
topdiff_nginx | 2018/12/14 16:42:29 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576
topdiff_nginx | 2018/12/14 16:42:29 [notice] 1#1: start worker processes
topdiff_nginx | 2018/12/14 16:42:29 [notice] 1#1: start worker process 45
topdiff_nginx | 2018/12/14 16:42:29 [notice] 1#1: start worker process 46
topdiff_nginx | 2018/12/14 16:42:29 [notice] 1#1: start worker process 47
topdiff_nginx | 2018/12/14 16:42:29 [notice] 1#1: start worker process 48
topdiff_nginx | 2018/12/14 16:42:29 [info] 45#45: [ngx_pagespeed 1.13.35.2-0] Reusing shared memory for path: /var/cache/ngx_pagespeed/ flush .
topdiff_nginx | 2018/12/14 16:42:29 [info] 47#47: [ngx_pagespeed 1.13.35.2-0] Reusing shared memory for path: /var/cache/ngx_pagespeed/ flush .
topdiff_nginx | 2018/12/14 16:42:29 [info] 46#46: [ngx_pagespeed 1.13.35.2-0] Reusing shared memory for path: /var/cache/ngx_pagespeed/ flush .
topdiff_nginx | 2018/12/14 16:42:29 [info] 48#48: [ngx_pagespeed 1.13.35.2-0] Reusing shared memory for path: /var/cache/ngx_pagespeed/ flush .
topdiff_nginx | 2018/12/14 16:44:25 [notice] 45#45: *1 "/wp-admin$" does not match "/", client: 172.18.0.3, server: default, request: "GET / HTTP/1.1", host: "topdiff.docker.localhost:8000"
topdiff_nginx | 2018/12/14 16:44:25 [notice] 45#45: *1 "/wp-admin$" does not match "/index.php", client: 172.18.0.3, server: default, request: "GET / HTTP/1.1", host: "topdiff.docker.localhost:8000"
topdiff_nginx | 2018/12/14 16:44:25 [error] 45#45: *1 FastCGI sent in stderr: "PHP message: PHP Warning:  file_put_contents(/var/www/html/web/wp-content/uploads/cache/1c90c6f62738a1c4e06e5e79254a3b93fadb4109.php): failed to open stream: Permission denied in /var/www/html/web/wp-content/themes/topdifference/vendor/illuminate/filesystem/Filesystem.php on line 122
topdiff_nginx | PHP message: PHP Warning:  include(/var/www/html/web/wp-content/uploads/cache/1c90c6f62738a1c4e06e5e79254a3b93fadb4109.php): failed to open stream: No such file or directory in /var/www/html/web/wp-content/themes/topdifference/vendor/illuminate/view/Engines/PhpEngine.php on line 43
topdiff_nginx | PHP message: PHP Warning:  include(): Failed opening '/var/www/html/web/wp-content/uploads/cache/1c90c6f62738a1c4e06e5e79254a3b93fadb4109.php' for inclusion (include_path='.:/usr/local/lib/php') in /var/www/html/web/wp-content/themes/topdifference/vendor/illuminate/view/Engines/PhpEngine.php on line 43" while reading response header from upstream, client: 172.18.0.3, server: default, request: "GET / HTTP/1.1", upstream: "fastcgi://172.18.0.4:9000", host: "topdiff.docker.localhost:8000"
topdiff_nginx | 172.18.0.3 - - [14/Dec/2018:16:44:25 +0000] "GET / HTTP/1.1" 200 347 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.2 Safari/605.1.15"
topdiff_nginx | 2018/12/14 16:44:27 [notice] 45#45: *1 "/wp-admin$" does not match "/", client: 172.18.0.3, server: default, request: "GET / HTTP/1.1", host: "topdiff.docker.localhost:8000"
topdiff_nginx | 2018/12/14 16:44:27 [notice] 45#45: *1 "/wp-admin$" does not match "/index.php", client: 172.18.0.3, server: default, request: "GET / HTTP/1.1", host: "topdiff.docker.localhost:8000"
topdiff_nginx | 2018/12/14 16:44:27 [error] 45#45: *1 FastCGI sent in stderr: "PHP message: PHP Warning:  file_put_contents(/var/www/html/web/wp-content/uploads/cache/1c90c6f62738a1c4e06e5e79254a3b93fadb4109.php): failed to open stream: Permission denied in /var/www/html/web/wp-content/themes/topdifference/vendor/illuminate/filesystem/Filesystem.php on line 122
topdiff_nginx | PHP message: PHP Warning:  include(/var/www/html/web/wp-content/uploads/cache/1c90c6f62738a1c4e06e5e79254a3b93fadb4109.php): failed to open stream: No such file or directory in /var/www/html/web/wp-content/themes/topdifference/vendor/illuminate/view/Engines/PhpEngine.php on line 43
topdiff_nginx | PHP message: PHP Warning:  include(): Failed opening '/var/www/html/web/wp-content/uploads/cache/1c90c6f62738a1c4e06e5e79254a3b93fadb4109.php' for inclusion (include_path='.:/usr/local/lib/php') in /var/www/html/web/wp-content/themes/topdifference/vendor/illuminate/view/Engines/PhpEngine.php on line 43" while reading response header from upstream, client: 172.18.0.3, server: default, request: "GET / HTTP/1.1", upstream: "fastcgi://172.18.0.4:9000", host: "topdiff.docker.localhost:8000"
topdiff_nginx | 172.18.0.3 - - [14/Dec/2018:16:44:27 +0000] "GET / HTTP/1.1" 200 347 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.2 Safari/605.1.15"
topdiff_nginx | 2018/12/14 16:44:28 [notice] 45#45: *1 "/wp-admin$" does not match "/", client: 172.18.0.3, server: default, request: "GET / HTTP/1.1", host: "topdiff.docker.localhost:8000"
topdiff_nginx | 2018/12/14 16:44:28 [notice] 45#45: *1 "/wp-admin$" does not match "/index.php", client: 172.18.0.3, server: default, request: "GET / HTTP/1.1", host: "topdiff.docker.localhost:8000"
topdiff_nginx | 172.18.0.3 - - [14/Dec/2018:16:44:28 +0000] "GET / HTTP/1.1" 200 347 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.2 Safari/605.1.15"
topdiff_nginx | 2018/12/14 16:44:28 [error] 45#45: *1 FastCGI sent in stderr: "PHP message: PHP Warning:  file_put_contents(/var/www/html/web/wp-content/uploads/cache/1c90c6f62738a1c4e06e5e79254a3b93fadb4109.php): failed to open stream: Permission denied in /var/www/html/web/wp-content/themes/topdifference/vendor/illuminate/filesystem/Filesystem.php on line 122
topdiff_nginx | PHP message: PHP Warning:  include(/var/www/html/web/wp-content/uploads/cache/1c90c6f62738a1c4e06e5e79254a3b93fadb4109.php): failed to open stream: No such file or directory in /var/www/html/web/wp-content/themes/topdifference/vendor/illuminate/view/Engines/PhpEngine.php on line 43
topdiff_nginx | PHP message: PHP Warning:  include(): Failed opening '/var/www/html/web/wp-content/uploads/cache/1c90c6f62738a1c4e06e5e79254a3b93fadb4109.php' for inclusion (include_path='.:/usr/local/lib/php') in /var/www/html/web/wp-content/themes/topdifference/vendor/illuminate/view/Engines/PhpEngine.php on line 43" while reading response header from upstream, client: 172.18.0.3, server: default, request: "GET / HTTP/1.1", upstream: "fastcgi://172.18.0.4:9000", host: "topdiff.docker.localhost:8000"
topdiff_nginx | 2018/12/14 16:44:30 [notice] 45#45: *1 "/wp-admin$" does not match "/wp-admin/admin-ajax.php", client: 172.18.0.3, server: default, request: "POST /wp-admin/admin-ajax.php HTTP/1.1", host: "topdiff.docker.localhost:8000", referrer: "http://topdiff.docker.localhost:8000/wp-admin/upload.php"
topdiff_nginx | 172.18.0.3 - - [14/Dec/2018:16:44:30 +0000] "POST /wp-admin/admin-ajax.php HTTP/1.1" 200 78 "http://topdiff.docker.localhost:8000/wp-admin/upload.php" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.2 Safari/605.1.15"
topdiff_nginx | 2018/12/14 16:44:35 [notice] 45#45: *1 "/wp-admin$" does not match "/wp-admin/async-upload.php", client: 172.18.0.3, server: default, request: "POST /wp-admin/async-upload.php HTTP/1.1", host: "topdiff.docker.localhost:8000", referrer: "http://topdiff.docker.localhost:8000/wp-admin/upload.php"
topdiff_nginx | 2018/12/14 16:44:35 [warn] 45#45: *1 a client request body is buffered to a temporary file /var/cache/nginx/client_temp/0000000001, client: 172.18.0.3, server: default, request: "POST /wp-admin/async-upload.php HTTP/1.1", host: "topdiff.docker.localhost:8000", referrer: "http://topdiff.docker.localhost:8000/wp-admin/upload.php"
topdiff_nginx | 172.18.0.3 - - [14/Dec/2018:16:44:35 +0000] "POST /wp-admin/async-upload.php HTTP/1.1" 200 171 "http://topdiff.docker.localhost:8000/wp-admin/upload.php" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.2 Safari/605.1.15"
topdiff_nginx | 2018/12/14 16:45:30 [notice] 45#45: *1 "/wp-admin$" does not match "/wp-admin/admin-ajax.php", client: 172.18.0.3, server: default, request: "POST /wp-admin/admin-ajax.php HTTP/1.1", host: "topdiff.docker.localhost:8000", referrer: "http://topdiff.docker.localhost:8000/wp-admin/upload.php"
topdiff_nginx | 172.18.0.3 - - [14/Dec/2018:16:45:30 +0000] "POST /wp-admin/admin-ajax.php HTTP/1.1" 200 78 "http://topdiff.docker.localhost:8000/wp-admin/upload.php" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.2 Safari/605.1.15"
topdiff_nginx | 2018/12/14 16:46:30 [notice] 45#45: *1 "/wp-admin$" does not match "/wp-admin/admin-ajax.php", client: 172.18.0.3, server: default, request: "POST /wp-admin/admin-ajax.php HTTP/1.1", host: "topdiff.docker.localhost:8000", referrer: "http://topdiff.docker.localhost:8000/wp-admin/upload.php"
topdiff_nginx | 172.18.0.3 - - [14/Dec/2018:16:46:30 +0000] "POST /wp-admin/admin-ajax.php HTTP/1.1" 200 78 "http://topdiff.docker.localhost:8000/wp-admin/upload.php" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.2 Safari/605.1.15"
topdiff_nginx | 2018/12/14 16:48:32 [notice] 45#45: *9 "/wp-admin$" does not match "/wp-admin/admin-ajax.php", client: 172.18.0.3, server: default, request: "POST /wp-admin/admin-ajax.php HTTP/1.1", host: "topdiff.docker.localhost:8000", referrer: "http://topdiff.docker.localhost:8000/wp-admin/upload.php"
topdiff_nginx | 172.18.0.3 - - [14/Dec/2018:16:48:32 +0000] "POST /wp-admin/admin-ajax.php HTTP/1.1" 200 78 "http://topdiff.docker.localhost:8000/wp-admin/upload.php" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.2 Safari/605.1.15"
topdiff_nginx | 2018/12/14 16:49:32 [notice] 45#45: *9 "/wp-admin$" does not match "/wp-admin/admin-ajax.php", client: 172.18.0.3, server: default, request: "POST /wp-admin/admin-ajax.php HTTP/1.1", host: "topdiff.docker.localhost:8000", referrer: "http://topdiff.docker.localhost:8000/wp-admin/upload.php"
topdiff_nginx | 172.18.0.3 - - [14/Dec/2018:16:49:32 +0000] "POST /wp-admin/admin-ajax.php HTTP/1.1" 200 78 "http://topdiff.docker.localhost:8000/wp-admin/upload.php" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.2 Safari/605.1.15"
topdiff_nginx | 2018/12/14 16:50:32 [notice] 45#45: *9 "/wp-admin$" does not match "/wp-admin/admin-ajax.php", client: 172.18.0.3, server: default, request: "POST /wp-admin/admin-ajax.php HTTP/1.1", host: "topdiff.docker.localhost:8000", referrer: "http://topdiff.docker.localhost:8000/wp-admin/upload.php"
topdiff_nginx | 172.18.0.3 - - [14/Dec/2018:16:50:32 +0000] "POST /wp-admin/admin-ajax.php HTTP/1.1" 200 78 "http://topdiff.docker.localhost:8000/wp-admin/upload.php" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.2 Safari/605.1.15"
topdiff_nginx | 2018/12/14 16:51:32 [notice] 45#45: *9 "/wp-admin$" does not match "/wp-admin/admin-ajax.php", client: 172.18.0.3, server: default, request: "POST /wp-admin/admin-ajax.php HTTP/1.1", host: "topdiff.docker.localhost:8000", referrer: "http://topdiff.docker.localhost:8000/wp-admin/upload.php"
topdiff_nginx | 172.18.0.3 - - [14/Dec/2018:16:51:32 +0000] "POST /wp-admin/admin-ajax.php HTTP/1.1" 200 78 "http://topdiff.docker.localhost:8000/wp-admin/upload.php" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.2 Safari/605.1.15"
topdiff_nginx | 2018/12/14 16:52:32 [notice] 45#45: *9 "/wp-admin$" does not match "/wp-admin/admin-ajax.php", client: 172.18.0.3, server: default, request: "POST /wp-admin/admin-ajax.php HTTP/1.1", host: "topdiff.docker.localhost:8000", referrer: "http://topdiff.docker.localhost:8000/wp-admin/upload.php"
topdiff_nginx | 172.18.0.3 - - [14/Dec/2018:16:52:32 +0000] "POST /wp-admin/admin-ajax.php HTTP/1.1" 200 78 "http://topdiff.docker.localhost:8000/wp-admin/upload.php" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.2 Safari/605.1.15"

Show your ls -la output of /var/www/html/web directory inside php container

Dear @csandanov ,

Please take a look at the result of $ ls -la command inside php container after $ make shell & cd web

wodby@php.container:/var/www/html/web $ ls -la
total 212
drwxr-xr-x    5 1000     root          4096 Dec 17 23:51 .
drwxr-xr-x    8 wodby    wodby         4096 Dec 17 23:51 ..
-rw-r--r--    1 1000     root           782 Dec 17 23:50 composer.json
-rw-r--r--    1 1000     root           418 Dec 17 23:50 index.php
-rw-r--r--    1 1000     root         19935 Dec 17 23:50 license.txt
-rw-r--r--    1 1000     root          7415 Dec 17 23:50 readme.html
-rw-r--r--    1 1000     root          6878 Dec 17 23:50 wp-activate.php
drwxr-xr-x    9 1000     root          4096 Dec 17 23:50 wp-admin
-rw-r--r--    1 1000     root           364 Dec 17 23:50 wp-blog-header.php
-rw-r--r--    1 1000     root          1889 Dec 17 23:50 wp-comments-post.php
-rw-r--r--    1 1000     root          2853 Dec 17 23:50 wp-config-sample.php
-rw-r--r--    1 1000     root          3212 Dec 17 23:50 wp-config.php
drwxr-xr-x    6 1000     root          4096 Dec 17 23:51 wp-content
-rw-r--r--    1 1000     root          3669 Dec 17 23:51 wp-cron.php
drwxr-xr-x   19 1000     root         12288 Dec 17 23:51 wp-includes
-rw-r--r--    1 1000     root          2422 Dec 17 23:51 wp-links-opml.php
-rw-r--r--    1 1000     root          3306 Dec 17 23:51 wp-load.php
-rw-r--r--    1 1000     root         37296 Dec 17 23:51 wp-login.php
-rw-r--r--    1 1000     root          8048 Dec 17 23:51 wp-mail.php
-rw-r--r--    1 1000     root         17421 Dec 17 23:51 wp-settings.php
-rw-r--r--    1 1000     root         30091 Dec 17 23:51 wp-signup.php
-rw-r--r--    1 1000     root          4620 Dec 17 23:51 wp-trackback.php
-rw-r--r--    1 1000     root          3065 Dec 17 23:51 xmlrpc.php

Oh, I see, you're on macos, you should change sync_userid to macos default 501 in docker-sync.yml

Dear @csandanov ,

Thank you for your answer,

Unfortunately even with userid 501 it's not working, uploads folder is still not writable, I already tried it previously. Then I've tried also adding a groupid 20 here too, but it's not working.

I cleaned up everything and make a new install from scratch, but still with no luck.

My docker-sync.yml

version: "2"

syncs:
  docker-sync:
    src: './'
    sync_userid: '501'
    sync_excludes: ['.gitignore', '.git/', '.idea/']
#  docker-sync-another-project:
#    src: '/absolute/path/to/project/codebase'
#    sync_userid: '1000'
#    sync_excludes: ['.gitignore', '.git/', '.idea/']

Please note, that I updated a Makefile too, by adding some docker-sync commands to up, stop, prune and ps

include .env

.PHONY: up down stop prune ps shell wp logs

default: up

WP_ROOT ?= /var/www/html/

up:
	@echo "Starting docker-sync for $(PROJECT_NAME)..."
	docker-sync start
	@echo "Starting up containers for $(PROJECT_NAME)..."
	docker-compose pull
	docker-compose up -d --remove-orphans

down: stop

stop:
	@echo "Stopping docker-sync containers for $(PROJECT_NAME)..."
	@docker-sync stop
	@echo "Stopping containers for $(PROJECT_NAME)..."
	@docker-compose stop

prune:
	@echo "Removing the container for sync and its volumes for $(PROJECT_NAME)..."
	@docker-sync clean
	@echo "Removing containers for $(PROJECT_NAME)..."
	@docker-compose down -v

ps:
	@docker ps --filter name='$(PROJECT_NAME)*'
	@echo "Docker Sync list sync-endpoints configured for $(PROJECT_NAME)"
	@docker-sync list

shell:
	docker exec -ti -e COLUMNS=$(shell tput cols) -e LINES=$(shell tput lines) $(shell docker ps --filter name='$(PROJECT_NAME)_php' --format "{{ .ID }}") sh

wp:
	docker exec $(shell docker ps --filter name='$(PROJECT_NAME)_php' --format "{{ .ID }}") wp --path=$(WP_ROOT) $(filter-out $@,$(MAKECMDGOALS))

logs:
	@docker-compose logs -f $(filter-out $@,$(MAKECMDGOALS))

# https://stackoverflow.com/a/6273809/1826109
%:
	@:

ls -la of PHP container

wodby@php.container:/var/www/html/web $ ls -la
total 212
drwxr-xr-x    5 wodby    root          4096 Dec 18 13:35 .
drwxr-xr-x    8 wodby    wodby         4096 Dec 18 13:38 ..
-rw-r--r--    1 wodby    root           782 Dec 18 13:34 composer.json
-rw-r--r--    1 wodby    root           418 Dec 18 13:34 index.php
-rw-r--r--    1 wodby    root         19935 Dec 18 13:34 license.txt
-rw-r--r--    1 wodby    root          7415 Dec 18 13:34 readme.html
-rw-r--r--    1 wodby    root          6878 Dec 18 13:34 wp-activate.php
drwxr-xr-x    9 wodby    root          4096 Dec 18 13:34 wp-admin
-rw-r--r--    1 wodby    root           364 Dec 18 13:34 wp-blog-header.php
-rw-r--r--    1 wodby    root          1889 Dec 18 13:34 wp-comments-post.php
-rw-r--r--    1 wodby    root          2853 Dec 18 13:34 wp-config-sample.php
-rw-r--r--    1 wodby    root          3212 Dec 18 13:34 wp-config.php
drwxr-xr-x    5 wodby    root          4096 Dec 18 13:34 wp-content
-rw-r--r--    1 wodby    root          3669 Dec 18 13:35 wp-cron.php
drwxr-xr-x   19 wodby    root         12288 Dec 18 13:35 wp-includes
-rw-r--r--    1 wodby    root          2422 Dec 18 13:35 wp-links-opml.php
-rw-r--r--    1 wodby    root          3306 Dec 18 13:35 wp-load.php
-rw-r--r--    1 wodby    root         37296 Dec 18 13:35 wp-login.php
-rw-r--r--    1 wodby    root          8048 Dec 18 13:35 wp-mail.php
-rw-r--r--    1 wodby    root         17421 Dec 18 13:35 wp-settings.php
-rw-r--r--    1 wodby    root         30091 Dec 18 13:35 wp-signup.php
-rw-r--r--    1 wodby    root          4620 Dec 18 13:35 wp-trackback.php
-rw-r--r--    1 wodby    root          3065 Dec 18 13:35 xmlrpc.php

You have two bind mounts, if you're using docker-sync, you should remove the first one.

      - ./:/var/www/html:cached # User-guided caching
      - docker-sync:/var/www/html # Docker-sync

https://wodby.com/docs/stacks/wordpress/local/#docker-sync

Dear @csandanov,

I tried all of them.

Currently, I'm using only one that uses docker-sync (docker-sync uses default sync strategy), the cached version is commented.

Unfortunately, it's not working.

I updated docker-compose.yml file

Docker compose file

   php:
    image: wodby/wordpress-php:$PHP_TAG
    container_name: "${PROJECT_NAME}_php"
    environment:
      PHP_SENDMAIL_PATH: /usr/sbin/sendmail -t -i -S mailhog:1025
      DB_HOST: $DB_HOST
      DB_USER: $DB_USER
      DB_PASSWORD: $DB_PASSWORD
      DB_NAME: $DB_NAME
## Read instructions at https://wodby.com/stacks/wordpress/docs/local/xdebug/
#      PHP_XDEBUG: 1
#      PHP_XDEBUG_DEFAULT_ENABLE: 1
#      PHP_XDEBUG_REMOTE_CONNECT_BACK: 0
#      PHP_IDE_CONFIG: serverName=my-ide
#      PHP_XDEBUG_REMOTE_HOST: 172.17.0.1 # Linux
#      PHP_XDEBUG_REMOTE_HOST: 10.254.254.254 # macOS
#      PHP_XDEBUG_REMOTE_HOST: 10.0.75.1 # Windows
    volumes:
#      - ./:/var/www/html
## For macOS users (https://wodby.com/stacks/wordpress/docs/local/docker-for-mac/)
#      - ./:/var/www/html:cached # User-guided caching
      - docker-sync:/var/www/html # Docker-sync
## For XHProf and Xdebug profiler traces
#      - files:/mnt/files

   nginx:
    image: wodby/nginx:$NGINX_TAG
    container_name: "${PROJECT_NAME}_nginx"
    depends_on:
      - php
    environment:
#      NGINX_PAGESPEED: "on"
      NGINX_STATIC_OPEN_FILE_CACHE: "off"
      NGINX_ERROR_LOG_LEVEL: debug
      NGINX_BACKEND_HOST: php
      NGINX_VHOST_PRESET: wordpress
      NGINX_SERVER_ROOT: /var/www/html/web
    volumes:
#      - ./:/var/www/html
# Options for macOS users (https://wodby.com/stacks/wordpress/docs/local/docker-for-mac/)
#      - ./:/var/www/html:cached # User-guided caching
      - docker-sync:/var/www/html # Docker-sync
    labels:
      - 'traefik.backend=nginx'
      - 'traefik.port=80'
      - 'traefik.frontend.rule=Host:${PROJECT_BASE_URL}'

I couldn't reproduce it from the clean setup with docker for mac (18.09.0) and default bind mounts (without docker-sync) – upload worked for me. Funny thing is I used default -dev images (with Linux uid 1000) and my wp-content/uploads did not have writing permissions for www-data user however upload still worked – files and directories somehow have been created under wodby user, I guess that's the tricks docker for mac uses for bind mounts to avoid permissions issues.

I recommend you to clean up all containers and volumes and try from scratch with the latest version 5.4.0. I used codebase from https://github.com/wodby/wordpress-composer project. If it does not work please paste output from PHP container and permissions of wp-content/uploads.


Actually now when I'm looking at your original warnings:

topdiff_php  | [14-Dec-2018 16:44:27] WARNING: [pool www] child 93 said into stderr: "NOTICE: PHP message: PHP Warning:  file_put_contents(/var/www/html/web/wp-content/uploads/cache/1c90c6f62738a1c4e06e5e79254a3b93fadb4109.php): failed to open stream: Permission denied in /var/www/html/web/wp-content/themes/topdifference/vendor/illuminate/filesystem/Filesystem.php on line 122"
topdiff_php  | [14-Dec-2018 16:44:27] WARNING: [pool www] child 93 said into stderr: "NOTICE: PHP message: PHP Warning:  include(/var/www/html/web/wp-content/uploads/cache/1c90c6f62738a1c4e06e5e79254a3b93fadb4109.php): failed to open stream: No such file or directory in /var/www/html/web/wp-content/themes/topdifference/vendor/illuminate/view/Engines/PhpEngine.php on line 43"
topdiff_php  | [14-Dec-2018 16:44:27] WARNING: [pool www] child 93 said into stderr: "NOTICE: PHP message: PHP Warning:  include(): Failed opening '/var/www/html/web/wp-content/uploads/cache/1c90c6f62738a1c4e06e5e79254a3b93fadb4109.php' for inclusion (include_path='.:/usr/local/lib/php') in /var/www/html/web/wp-content/themes/topdifference/vendor/illuminate/view/Engines/PhpEngine.php on line 43"

it seems this is not a permissions error at all and related to the theme topdifference not being able to find some cache, I guess you imported existing database and probably should rebuild WP cache via wp cli

Thank you for your answer and your time.

I will try again from scratch with the latest version 5.4.0.

I'm using a Sage starter theme from Roots that uses Blade as its templates engine.
Normally after refresh, all built Blade templates should be stores inside wp-content/uploads/cache folder, but since it doesn't have write permissions it can't put them there. Cache folder is always empty.

As well as media upload is not working due to the same permissions issues.

If I'm setting write permissions and www-data user manually, everything is working fine, just as expected.

Dear @csandanov,

Finally, I finished all my tests with new docker4wordpress (5.4.0) and cleaned volumes/containers.

And here're some results:

  1. It's still not working with docker-sync on macOS - - docker-sync:/var/www/html
  2. It's working fine with default bind mount - ./:/var/www/html
  3. It's working fine with user-guided caching enabled - ./:/var/www/html:cached

However permissions/users/groups are quite different, please take a look below.

It's strange that for some folders user/group is wodby with default bind mount, with caching enabled it's www-data and with docker-sync it's root. Is it ok and how I can fix this issue? Will be really appreciate for your help

Docker-sync

ls -la inside web folder of php container

wodby@php.container:/var/www/html/web $ ls -la
total 212
drwxr-xr-x    5 wodby    root          4096 Dec 24 00:50 .
drwxr-xr-x    8 wodby    wodby         4096 Dec 24 00:50 ..
-rw-r--r--    1 wodby    root           782 Dec 24 00:49 composer.json
-rw-r--r--    1 wodby    root           418 Dec 24 00:49 index.php
-rw-r--r--    1 wodby    root         19935 Dec 24 00:49 license.txt
-rw-r--r--    1 wodby    root          7415 Dec 24 00:49 readme.html
-rw-r--r--    1 wodby    root          6878 Dec 24 00:49 wp-activate.php
drwxr-xr-x    9 wodby    root          4096 Dec 24 00:49 wp-admin
-rw-r--r--    1 wodby    root           364 Dec 24 00:49 wp-blog-header.php
-rw-r--r--    1 wodby    root          1889 Dec 24 00:49 wp-comments-post.php
-rw-r--r--    1 wodby    root          2853 Dec 24 00:49 wp-config-sample.php
-rw-r--r--    1 wodby    root          3212 Dec 24 00:49 wp-config.php
drwxr-xr-x    6 wodby    root          4096 Dec 24 00:50 wp-content
-rw-r--r--    1 wodby    root          3669 Dec 24 00:50 wp-cron.php
drwxr-xr-x   19 wodby    root         12288 Dec 24 00:50 wp-includes
-rw-r--r--    1 wodby    root          2422 Dec 24 00:50 wp-links-opml.php
-rw-r--r--    1 wodby    root          3306 Dec 24 00:50 wp-load.php
-rw-r--r--    1 wodby    root         37296 Dec 24 00:50 wp-login.php
-rw-r--r--    1 wodby    root          8048 Dec 24 00:50 wp-mail.php
-rw-r--r--    1 wodby    root         17421 Dec 24 00:50 wp-settings.php
-rw-r--r--    1 wodby    root         30091 Dec 24 00:50 wp-signup.php
-rw-r--r--    1 wodby    root          4620 Dec 24 00:50 wp-trackback.php
-rw-r--r--    1 wodby    root          3065 Dec 24 00:50 xmlrpc.php

ls -la inside wp-content folder of php container

wodby@php.container:/var/www/html/web/wp-content $ ls -la
total 28
drwxr-xr-x    6 wodby    root          4096 Dec 24 00:50 .
drwxr-xr-x    5 wodby    root          4096 Dec 24 00:50 ..
-rw-r--r--    1 wodby    root            28 Dec 24 00:49 index.php
drwxr-xr-x    3 wodby    root          4096 Dec 24 00:49 mu-plugins
drwxr-xr-x    3 wodby    root          4096 Dec 24 00:49 plugins
drwxr-xr-x    6 wodby    root          4096 Dec 24 00:50 themes
drwxr-xr-x    4 wodby    root          4096 Dec 24 00:50 uploads

Default bind mount

ls -la inside web folder of php container

wodby@php.container:/var/www/html/web $ ls -la
total 184
drwxr-xr-x   23 wodby    wodby          736 Dec 23 04:23 .
drwxr-xr-x   18 wodby    wodby          576 Dec 24 00:32 ..
-rw-r--r--    1 wodby    wodby          782 Dec 13 03:42 composer.json
-rw-r--r--    1 wodby    wodby          418 Dec 13 03:42 index.php
-rw-r--r--    1 wodby    wodby        19935 Dec 13 03:42 license.txt
-rw-r--r--    1 wodby    wodby         7415 Dec 13 03:42 readme.html
-rw-r--r--    1 wodby    wodby         6878 Dec 13 03:42 wp-activate.php
drwxr-xr-x   91 wodby    wodby         2912 Dec 13 03:42 wp-admin
-rw-r--r--    1 wodby    wodby          364 Dec 13 03:42 wp-blog-header.php
-rw-r--r--    1 wodby    wodby         1889 Dec 13 03:42 wp-comments-post.php
-rw-r--r--    1 wodby    wodby         2853 Dec 13 03:42 wp-config-sample.php
-rw-r--r--    1 wodby    wodby         3212 Dec 18 18:26 wp-config.php
drwxr-xr-x    7 wodby    wodby          224 Dec 24 00:40 wp-content
-rw-r--r--    1 wodby    wodby         3669 Dec 13 03:42 wp-cron.php
drwxr-xr-x  193 wodby    wodby         6176 Dec 13 03:42 wp-includes
-rw-r--r--    1 wodby    wodby         2422 Dec 13 03:42 wp-links-opml.php
-rw-r--r--    1 wodby    wodby         3306 Dec 13 03:42 wp-load.php
-rw-r--r--    1 wodby    wodby        37296 Dec 13 03:42 wp-login.php
-rw-r--r--    1 wodby    wodby         8048 Dec 13 03:42 wp-mail.php
-rw-r--r--    1 wodby    wodby        17421 Dec 13 03:42 wp-settings.php
-rw-r--r--    1 wodby    wodby        30091 Dec 13 03:42 wp-signup.php
-rw-r--r--    1 wodby    wodby         4620 Dec 13 03:42 wp-trackback.php
-rw-r--r--    1 wodby    wodby         3065 Dec 13 03:42 xmlrpc.php

ls -la inside wp-content folder of php container

wodby@php.container:/var/www/html/web/wp-content $ ls -la
total 4
drwxr-xr-x    7 wodby    wodby          224 Dec 24 00:40 .
drwxr-xr-x   23 wodby    wodby          736 Dec 23 04:23 ..
-rw-r--r--    1 wodby    wodby           28 Dec 13 03:42 index.php
drwxr-xr-x    4 wodby    wodby          128 Dec 23 04:23 mu-plugins
drwxr-xr-x    5 wodby    wodby          160 Dec 13 03:42 plugins
drwxr-xr-x    7 wodby    wodby          224 Dec 23 04:23 themes
drwxr-xr-x    4 wodby    wodby          128 Dec 24 00:40 uploads

User-guided caching enabled

ls -la inside web folder of php container

wodby@php.container:/var/www/html/web $ ls -la
total 184
drwxr-xr-x   23 wodby    wodby          736 Dec 23 04:23 .
drwxr-xr-x   18 wodby    wodby          576 Dec 24 01:01 ..
-rw-r--r--    1 wodby    wodby          782 Dec 13 03:42 composer.json
-rw-r--r--    1 wodby    wodby          418 Dec 13 03:42 index.php
-rw-r--r--    1 wodby    wodby        19935 Dec 13 03:42 license.txt
-rw-r--r--    1 wodby    wodby         7415 Dec 13 03:42 readme.html
-rw-r--r--    1 wodby    wodby         6878 Dec 13 03:42 wp-activate.php
drwxr-xr-x   91 100      101           2912 Dec 13 03:42 wp-admin
-rw-r--r--    1 wodby    wodby          364 Dec 13 03:42 wp-blog-header.php
-rw-r--r--    1 wodby    wodby         1889 Dec 13 03:42 wp-comments-post.php
-rw-r--r--    1 wodby    wodby         2853 Dec 13 03:42 wp-config-sample.php
-rw-r--r--    1 www-data www-data      3212 Dec 18 18:26 wp-config.php
drwxr-xr-x    7 wodby    wodby          224 Dec 24 00:40 wp-content
-rw-r--r--    1 wodby    wodby         3669 Dec 13 03:42 wp-cron.php
drwxr-xr-x  193 www-data www-data      6176 Dec 13 03:42 wp-includes
-rw-r--r--    1 wodby    wodby         2422 Dec 13 03:42 wp-links-opml.php
-rw-r--r--    1 www-data www-data      3306 Dec 13 03:42 wp-load.php
-rw-r--r--    1 wodby    wodby        37296 Dec 13 03:42 wp-login.php
-rw-r--r--    1 wodby    wodby         8048 Dec 13 03:42 wp-mail.php
-rw-r--r--    1 www-data www-data     17421 Dec 13 03:42 wp-settings.php
-rw-r--r--    1 wodby    wodby        30091 Dec 13 03:42 wp-signup.php
-rw-r--r--    1 wodby    wodby         4620 Dec 13 03:42 wp-trackback.php
-rw-r--r--    1 wodby    wodby         3065 Dec 13 03:42 xmlrpc.php

ls -la inside wp-content folder of php container

wodby@php.container:/var/www/html/web/wp-content $ ls -la
total 4
drwxr-xr-x    7 wodby    wodby          224 Dec 24 00:40 .
drwxr-xr-x   23 wodby    wodby          736 Dec 23 04:23 ..
-rw-r--r--    1 wodby    wodby           28 Dec 13 03:42 index.php
drwxr-xr-x    4 wodby    wodby          128 Dec 23 04:23 mu-plugins
drwxr-xr-x    5 www-data www-data       160 Dec 13 03:42 plugins
drwxr-xr-x    7 www-data www-data       224 Dec 23 04:23 themes
drwxr-xr-x    4 www-data www-data       128 Dec 24 00:40 uploads

It's strange that for some folders user/group is wodby with default bind mount, with caching enabled it's www-data and with docker-sync it's root. Is it ok and how I can fix this issue? Will be really appreciate for your help

Having root group with docker-sync is not surprising because it has only user id (sync_userid) in its configuration. By default docker-sync uses unison strategy that as it seems does not support group id mapping unlike rsync EugenMayer/docker-sync#216. So, try changing docker-sync strategy to rsync.