I’m using Nextcloud on Docker. Here is my compose file:
# Nextcloud
services:
db:
image: postgres
restart: always
volumes:
- ${PATH_TO_DATA}/postgresql/db:/var/lib/postgresql/data
environment:
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
redis:
image: redis
restart: always
app:
image: nextcloud
restart: unless-stopped
ports:
- 8080:80
volumes:
- ${PATH_TO_DATA}/nextcloud/html:/var/www/html
environment:
- POSTGRES_HOST=db
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- REDIS_HOST=redis
depends_on:
- db
- redis
cron:
image: nextcloud
restart: always
volumes:
- nextcloud:/var/www/html
entrypoint: /cron.sh
depends_on:
- db
- redis
volumes:
db:
nextcloud:
So I’m looking at the documentation regarding Hardening and security guidance
and it says:
Place data directory outside of the web root
It is highly recommended to place your data directory outside of the Web root (i.e. outside of/var/www). It is easiest to do this on a new installation.
In my case I have:
${PATH_TO_DATA}/nextcloud/html:/var/www/html
Does this apply to placing the data outside of the Web root or does moving the directory when you are using docker even an issue?
If this isn’t the solution can anyone suggest a solution to moving the data directory in a Nextcloud Docker installation?