Moving Nextcloud from iocage to docker

dnilgreb

Contributor
Joined
Mar 29, 2016
Messages
168
I am trying to move all my iocage jails to docker containers. I have finished most of them, and the turn has come to Nextcloud along with Collabora. I need som help sorting out a few things before I really get started.

I have set up a docker host with docker-compose running Portainer.

Current setup:
I have Nextcloud running in an iocage jail on my TrueNAS Core 13 server. I followed Samuel Dowlings guide when I set it up, so I have three datasets outside of the jail.

nextcloud/data nextcloud/db nextcloud/themes

These are mounted as storage to my Nextcloud iocage jail.

I would really like to point my new docker install of Nextcloud to these, and not have to create a new database and start from scratch.
Here is my first question. How do I mount them into my docker container using Portainer? Should this be done via SMB sharing, or is there a smarter way?

The next question is permissions. All three datasets above are owned by user www and group www. So I have those in my TrueNAS, and alson in my Nextcloud jail, using tha same UID and GID in both places. Should I create that user and group on my docker host? In my nextcloud container? Or just share the datasets to that user and mount them from Portainer using the www user? Or something different entirely?

I have started putting together my nextcloud stack, so for it looks like this

version: "3.3" services: traefik: image: traefik:v2.10 container_name: traefik restart: unless-stopped ports: - "80:80" - "8081:8080" - "443:443" command: - "--api=true" - "--api.insecure=true" - "--api.dashboard=true" #- "--log.level=DEBUG" - "--log.filePath=/etc/traefik/traefik.log" - "--providers.docker.endpoint=unix:///var/run/docker.sock" - "--providers.docker.exposedbydefault=false" # - "--providers.docker.network=traefik_proxy" - "--providers.docker.network=nextcloud_default" - "--providers.file.filename=/etc/traefik/config/tls.yaml" - "--providers.file.watch=true" - "--entrypoints.web.address=:80" - "--entrypoints.web-secure.address=:443" # Let's Encrypt - "--certificatesresolvers.letsencryptresolver.acme.httpchallenge.entrypoint=web" - "--certificatesresolvers.letsencryptresolver.acme.httpchallenge=true" - "--certificatesresolvers.letsencryptresolver.acme.email=email@example.com" - "--certificatesresolvers.letsencryptresolver.acme.storage=/etc/traefik/acme.json" # Logging options, what to log - "--accesslog=true" - "--accesslog.format=json" - "--accessLog.filters.statusCodes=400-499" volumes: - /home/docker//traefik:/etc/traefik - /var/run/docker.sock:/var/run/docker.sock:ro nextcloud-collabora: image: collabora/code container_name: collabora restart: unless-stopped ports: - 9980:9980 expose: - "9980" environment: #should work as "domain=cloud1\.nextcloud\.com|cloud2\.nextcloud\.com" - domain={cloud.berglind.eu} - 'dictionaries=en_US,se_SE' - VIRTUAL_PROTO=http - VIRTUAL_PORT=9980 - VIRTUAL_HOST={`office.berglind.eu`} - username=username - password=password - "extra_params=--o:ssl.enable=false --o:ssl.termination=true" cap_add: - MKNOD tty: true labels: - "traefik.enable=true" - "traefik.docker.network=traefik_default" - "traefik.http.routers.collabora.rule=Host(`office.berglind.eu`)" - "traefik.http.routers.collabora.entrypoints=web" - "traefik.http.middlewares.collabora-https-redirect.redirectscheme.scheme=https" - "traefik.http.routers.collabora.middlewares=collabora-https-redirect" - "traefik.http.routers.collabora-secure.entrypoints=web-secure" - "traefik.http.routers.collabora-secure.rule=Host(`office.berglind.eu`)" - "traefik.http.routers.collabora-secure.tls=true" - "traefik.http.routers.collabora-secure.tls.certresolver=letsencryptresolver"

It works fine, meaning it installed a certificate for office.berglind.eu, which is accessible.
Now I have to get Nextcloud in there, using my three datasets above.

I have looked at numerous nextcloud stacks for this, but haven´t found one that covers everything. If someone has a recommendation, that would be nice...
Anyone with the time and energy to help me out?
 
Top