Having trouble running nextcloud from a docker image (nextcloudpi) and using a usb drive to store files

So I initially had run a container with the nextcloudpi image running from a usb drive. For context I ran this command: 'docker run -d -p 4443:4443 -p 443:443 -p 80:80 -v /media/cloudfiles/ncdatadocker:/data --name nextcloudpi ownyourbits/nextcloudpi-armhf '. After it was up and running I configured everything the way I liked it and began uploading files to it. It worked fine until I had to reboot my pi. When I tried running the same command to start the container using the previous data folder that is linked to the usb drive, it just created a new folder with the name ‘ncdatadocker’ except inside of the data folder that I had all of the previous nextcloud files in. How do I just get docker to use my previous nextcloud folders from before? No matter what I try it will just end up recreating a subfolder with the name of the mount folder and brand new nextcloud files inside.

After creating the container, if you want it to start automatically after a reboot, run

docker update --restart=unless-stopped nextcloudpi

If not auto started run

docker start nextcloudpi

If you want to start a new container with the same name, first remove it with

docker rm nextcloudpi

Check this wiki article for more