I know this is late, but I've been working on the same thing....I've had a heck of a time trying to get everything just right...spent about 5 days on it. I originally tried to mount SMB shares to the docker ( those are the volumes I declared as external)
Code
sudo docker volume create --driver local --opt type=cifs --opt device=//<IP>/NextCloud/files --opt o=username=nextcloud,password=<SMB share password>,uid=33,gid=33,file_mode=0777,dir_mode=0777 nextcloudData # the GUID 33 is www-data user
to
sudo docker volume create --driver local --opt type=cifs --opt device=//<IP>/NextCloud/config --opt o=username=nextcloud,password=<SMB share password>,uid=33,gid=33,file_mode=0770,dir_mode=0770 nextcloudConfig
Still working on the SWAG part, but here is my docker compose file:
Code
version: '3.3'
volumes:
nextcloudHTML:
nextcloudData:
external: true
nextcloudConfig:
external: true
nxtdb:
networks:
nextCloudPrivate:
webservicesNet:
external:
name: webservicesNet
services:
nxtclddb:
image: mariadb
container_name: nxtclddb
hostname: nxtclddb
restart: unless-stopped
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
volumes:
- nxtdb:/var/lib/mysql:z
- /etc/localtime:/etc/localtime:ro
environment:
- MYSQL_ROOT_PASSWORD=<SQLROOTPW>
- MYSQL_PASSWORD=<anotherUserPASSWORD>
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
networks:
- nextCloudPrivate
nextcloud:
image: nextcloud
container_name: nextcloud
hostname: nextcloud
ports:
- "4545:80"
restart: unless-stopped
volumes:
- /etc/localtime:/etc/localtime:ro
- nextcloudHTML:/var/www/html:z
- nextcloudData:/var/www/html/data:z
- nextcloudConfig:/var/www/html/config:z
environment:
- MYSQL_HOST=nxtclddb
- MYSQL_PASSWORD=<anotherUSERPAssword>
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
- NEXTCLOUD_ADMIN_USER=admin
- NEXTCLOUD_ADMIN_PASSWORD=<NEXTCLoudWEBAdminPassword>
- NEXTCLOUD_TRUSTED_DOMAINS=""nextcloud.* localhost <my site example url>/nextcloud""
networks:
- nextCloudPrivate
- webservicesNet
Alles anzeigen