What I want to to do is host a directory on my machine in nextcloud. Meaning I have a folder on my machine /data/media that I would like to be the root folder when I open nextcloud. Here is a snippet of my attempt in docker-compose
nextcloud:
image: nextcloud:fpm-alpine
restart: always
volumes:
- nextcloud:/var/www/html
- /data/media:/var/www/html/data/danrneal/files
environment:
- POSTGRES_HOST=postgres
- REDIS_HOST=redis
env_file:
- db.env
depends_on:
- postgres
- redis
However when I docker-compose up and try to set an account I get the following error: Cannot create or write into the data directory /var/www/html/data
. Now I figure that the container doesn’t have the right permissions on /data/media… I need to have www-data own that folder… but that doesn’t work either because outside my container, www-data’s uid is 33 and inside the container the uid is 82 so it’s still mad. Then I come across Add env variables to change UID/GID of www-data by jan-di · Pull Request #1278 · nextcloud/docker · GitHub which would allow me to specify a uid for the www-data user inside the container… but that PR has been sitting there for over a year. It’s been approved and remains unmerged.
I guess my question is, is there an easier way to do what I am trying to accomplish?