Understanding the docker container/image and its folders

I would like to understand the docker container. Sidenote: I moved my non-docker installation to docker via the ncp-restore command.

The container has /data/nextcloud/config, data etc.
It also has /var/www/nextcloud/config, data etc.

It also has /data/etc/apache2 and /etc/apache2

Which of those is actually used? Are they linked?

If I create a new container the nextcloud/config/config.php points to
‘datadirectory’ => ‘/data/nextcloud/data’,

But my container with the moved installation points to
‘datadirectory’ => ‘/var/www/nextcloud/data’,

My data is actually at /data/nextcloud/data since the volume mounted to /data does contain nextcloud/data.

Should I change the path in the config.php?

Thanks in advance.

Did you check the official description?

Overview of the folders that can be mounted as volumes:
/var/www/html Main folder, needed for updating
/var/www/html/custom_apps installed / modified apps
/var/www/html/config local configuration
/var/www/html/data the actual data of your Nextcloud
/var/www/html/themes/<YOUR_CUSTOM_THEME> theming/branding

Is that doc also valid for the ncp/nextcloudpi docker image?

did you check their docs?

Well, yes. But there is nothing about duplicate folders. So do you know anything about the topic?

in general there is nothing special in having multiple folder with same name (and maybe even content) in different places. this could happen after you (or the manager of the container) changes paths, makes copies and so on. sometimes software is written in a way it searches different locations for config files. In you case it sounds your system is using wrong directories for data, config an so on…

I have no clue about ncp but I feel I understand docker well. I think your installation in confused with previously existed paths and once the system didn’t found the paths it might have created them. maybe the ncp-restore is not the right way to move “FAT” installation to ncp and you should follow the official migration guide to dockerize your system before you finally move to ncp.

the easiest way is probably to configure your mount points to match your old installation paths - but this might brake ncp logic like backup scripts - you should double check every corner of the system (always recommended after potentially dangerous operations).