Problem running 12.0.4 through docker-compose

Nextcloud version: 12.0.4 (nextcloud:12.0.4-apache from the docker hub)
Operating system and version: Debian Stable (using Docker 1.13.1; Debian Stable/sloppy host system)
Apache or nginx version: Nginx reverse proxy at the front, v 1.13.6 (jwilder/nginx-proxy:latest); apache 2.4.10 inside of container
PHP version: 7.1.11

The issue you are facing:
Everything seems to spin up as normal, I can even run OCC commands including maintenance:install, but when I visit the URL in my web browser, I get the following error in my logs, and the page does not load.

nextcloud_1                          | [Fri Dec 15 04:45:24.612120 2017] [php7:notice] [pid 47] [client 172.18.0.3:53842] {"reqId":"li9tyAFiEkOufA1by43k","level":3,"time":"2017-12-15T04:45:24+00:00","remoteAddr":"172.18.0.3","user":"--","app":"PHP","method":"GET","url":"\\/settings\\/admin","message":"touch(): Utime failed: Permission denied at \\/var\\/www\\/html\\/lib\\/private\\/Config.php#239","userAgent":"Mozilla\\/5.0 (X11; Linux x86_64; rv:57.0) Gecko\\/20100101 Firefox\\/57.0","version":""}
nextcloud_1                          | [Fri Dec 15 04:45:24.612299 2017] [php7:notice] [pid 47] [client 172.18.0.3:53842] {"reqId":"li9tyAFiEkOufA1by43k","level":3,"time":"2017-12-15T04:45:24+00:00","remoteAddr":"172.18.0.3","user":"--","app":"PHP","method":"GET","url":"\\/settings\\/admin","message":"fopen(\\/var\\/www\\/html\\/config\\/config.php): failed to open stream: Permission denied at \\/var\\/www\\/html\\/lib\\/private\\/Config.php#240","userAgent":"Mozilla\\/5.0 (X11; Linux x86_64; rv:57.0) Gecko\\/20100101 Firefox\\/57.0","version":""}
nextcloud_1                          | [Fri Dec 15 04:45:24.612425 2017] [php7:notice] [pid 47] [client 172.18.0.3:53842] {"reqId":"li9tyAFiEkOufA1by43k","level":3,"time":"2017-12-15T04:45:24+00:00","remoteAddr":"172.18.0.3","user":"--","app":"PHP","method":"GET","url":"\\/settings\\/admin","message":"chmod(): Operation not permitted at \\/var\\/www\\/html\\/lib\\/private\\/Config.php#243","userAgent":"Mozilla\\/5.0 (X11; Linux x86_64; rv:57.0) Gecko\\/20100101 Firefox\\/57.0","version":""}
nextcloud_1                          | [Fri Dec 15 04:45:24.795646 2017] [php7:notice] [pid 47] [client 172.18.0.3:53842] {"reqId":"li9tyAFiEkOufA1by43k","level":3,"time":"2017-12-15T04:45:24+00:00","remoteAddr":"172.18.0.3","user":"--","app":"PHP","method":"GET","url":"\\/settings\\/admin","message":"Doctrine\\\\DBAL\\\\Exception\\\\TableNotFoundException: An exception occurred while executing 'SELECT * FROM \\"oc_appconfig\\"':\\n\\nSQLSTATE[HY000]: General error: 1 no such table: oc_appconfig at \\/var\\/www\\/html\\/3rdparty\\/doctrine\\/dbal\\/lib\\/Doctrine\\/DBAL\\/Driver\\/AbstractSQLiteDriver.php#58","userAgent":"Mozilla\\/5.0 (X11; Linux x86_64; rv:57.0) Gecko\\/20100101 Firefox\\/57.0","version":""}
nextcloud_1                          | [Fri Dec 15 04:45:24.795899 2017] [php7:notice] [pid 47] [client 172.18.0.3:53842] {"reqId":"li9tyAFiEkOufA1by43k","level":3,"time":"2017-12-15T04:45:24+00:00","remoteAddr":"172.18.0.3","user":"--","app":"PHP","method":"GET","url":"\\/settings\\/admin","message":"fopen(\\/var\\/www\\/html\\/data\\/nextcloud.log): failed to open stream: Permission denied at \\/var\\/www\\/html\\/lib\\/private\\/Log\\/File.php#132","userAgent":"Mozilla\\/5.0 (X11; Linux x86_64; rv:57.0) Gecko\\/20100101 Firefox\\/57.0","version":""}

It seems as though NC doesn’t have permission to access the ./nextcloud/userdata:/var/www/html volume, but the permissions seem to be correct – www-data:root. I was running 12.0.3 with the same configuration and everything worked fine.

My docker-compose file:


version: "2"
services:
    nginx_proxy:    # reverse proxy
      image: nginx-reverse-proxy
      ports:
        - "80:80"
        - "443:443"
      volumes:
        - /run/docker.sock:/tmp/docker.sock:ro
        - ./revProx/webroot/:/usr/share/nginx/html
        - ./revProx/vhost.d:/etc/nginx/vhost.d
        - ./revProx/certs:/etc/nginx/certs
    letsencrypt_nginx_proxy_companion: # should automatically handle
      image: jrcs/letsencrypt-nginx-proxy-companion #letsencrypt config
      volumes:
        - /run/docker.sock:/var/run/docker.sock:ro
        - ./revProx/certs:/etc/nginx/certs
      volumes_from:
        - nginx_proxy
      depends_on:            #?
        - nginx_proxy
      environment:
#        ACME_TOS_HASH: cc88d8d9517f490191401e7b54e9ffd12a2b9082ec7a1d4cec6101f9f1647e7b
        ACME_CA_URI: https://acme-staging.api.letsencrypt.org/directory
    nxt_db:
      image: mariadb:10.3.2
      restart: always
      volumes: 
        - ./nextcloud/database:/var/lib/mysql
      environment:
        MYSQL_RANDOM_ROOT_PASSWORD:  'yes'
        MYSQL_DATABASE:             nextcloud
        MYSQL_USER:                 nextcloud
      env_file:
        - nextcloud.pw.env
      depends_on:
        - letsencrypt_nginx_proxy_companion
    nextcloud:
      image: nextcloud:12.0.4
      links:
        - nxt_db
      depends_on:
        - nxt_db
      volumes:
        - ./nextcloud/userdata:/var/www/html
        - ./nextcloud/remote_shares:/home/
      restart: always
      environment:
        VIRTUAL_HOST: cloud.madscientists.co
        VIRTUAL_NETWORK: nginx-proxy
        DEFAULT_HOST: cloud.madscientists.co
        LETSENCRYPT_HOST: cloud.madscientists.co
        LETSENCRYPT_EMAIL: sysadmin@tams.tech
collabora:
  image: 'collabora/code'
  links:
    - nextcloud
  expose:
    - 9980
  cap_add:
    - MKNOD
  environment:
    domain:               cloud\\.madscientists\\.co
    VIRTUAL_HOST:         office.madscientists.co
    DEFAULT_HOST:         office.madscientists.co
    VIRTUAL_PORT:         9980
    VIRTUAL_PROTO:        https
    LETSENCRYPT_HOST:     office.madscientists.co
    LETSENCRYPT_EMAIL:    sysadmin@tams.tech
drawio:
  image: ivonet/draw.io
  volumes:
    - ./apache_conf:/etc/apache2
  environment:
    VIRTUAL_HOST: draw.madscientists.co
    DEFAULT_HOST: draw.madscientists.co
    LETSENCRYPT_HOST: draw.madscientists.co
    LETSENCRYPT_EMAIL: sysadmin@tams.tech

If you try to expose the nextcloud container without the nginx reverse proxy, what happens?
I’m using fpm myself instead of apache but maybe the user in the nginx.conf is still relevant?