Docker Compose Synology

2/12/2022by admin

Docker-compose is actually already on version 3.8. In Visual Code Studio, we're going to be adding all the information one after the other in a single file. You could have multiple docker-compose files but it kind of defeats the purpose of what we're trying to achieve. However In order to passthrough hardware you need to deploy the container using docker-compose, I get the premise of the compose file as pretty used to seeing examples of them however for the one I have created when I try to start the container I get a number of errors. It seems most ARM Synology don't support seccomp, so the Docker container has unfettered access to your system (even more so than with a regular docker). Again, due to Synology constraints, all containers need to use-network=host (or networkmode: host in compose) and everything will be directly accessible from the host. There are no port maps.

Compose
In this tutorial, we are going to use Docker compose to install the NextCloud official Docker image with Portainer.

To start​


This is going to be just one of many ways to install NextCloud. I am going to show you my way.
First, you need to have Docker installed on your NAS (if it's supported).
Now install Portainer. You can use @Rusty's tutorial: Docker - Portainer - Docker container managment made easy

Database​


Now that we have all the required tools, first, install the MariaDB using this tutorial: Docker - MariaDB - one of the most popular database servers
You can also use MySQL or PostgreSQL, but in this tutorial, we are using MariaDB.
For accessing the database I use phpMyAdmin: Docker - phpMyAdmin - A web interface for MySQL and MariaDB
Login to phpMyAdmin and create a database for Nextcloud. Write down your database name, database user, and password. You are going to need this later.

Synology Docker Compose Gui


NextCloud​


First, make sure to create folders for Nextcloud in your FileStation before you enter the docker-compose code.
I am using this location: docker/nextcloud. and this is on Volume 1:
  • /volume1/docker/nextcloud/html
  • /volume1/docker/nextcloud/custom_apps
  • /volume1/docker/nextcloud/config
  • /volume1/docker/nextcloud/data
  • /volume1/docker/nextcloud/themes


Now we are going to use the official image: https://hub.docker.com/_/nextcloud.
Login to your Portainer and create a Stack (read more about how to use stacks here: Docker - Portainer - using stacks (docker-compose)).
Now use this docker-compose:

We are using the latestDocker Compose Synology image.
Use NEXTCLOUD_TRUSTED_DOMAINS variable if you are using a custom domain, otherwise, you can remove it.

Use OVERWRITEPROTOCOL=https variable to redirect your domain to HTTPS protocol. If you won't use your custom domain for NextCloud and use it only locally, then you can remove this variable too.

You can change the port if you wish (the left number only).
Make sure to change the PUID and PGID to your http user ID and group (Tutorial - How to find UID (userID) and GID (groupID)?).
Change TZ to your timezone.
The next three variables are for the database. Make sure to use the right credentials.
*Note that I like to have the database separated and not in the same stack, but you can combine it together in one stack.
For host use yourNASip:databaseLocalPort.

Deploy the stack and that should be enough. Open NextCloud on yourNASip:nextcloudPort. Continue with the guided NextCloud installation.

Update Docker Compose Synology

As already said, this can be done in many ways. I hope this way will help someone to install NextCloud.
Related resources

Docker - phpMyAdmin - A web interface for MySQL and MariaDB

phpMyAdmin - A web interface for MySQL and MariaDB In this tutorial, we are going to use this image: phpmyadmin/phpmyadmin In DSM go to Docker -> Registry and search for phpmyadmin: Download the second result, phpmyadmin/phpmyadmin image...

Docker - MariaDB - one of the most popular database servers

Mariadb is one of the most popular database servers. Made by the original developers of MySQL. In this tutorial, we are going to use this image: linuxserver/mariadb In DSM go to Docker -> Registry and search for mariadb: Download the second...

Tutorial - How to find UID (userID) and GID (groupID)?

First, you need to SSH into your NAS. When you are in your NAS with the user you want the ID for, just type id and hit Enter. Now you'll get something like this: uid=1031(your_nas_user) gid=100(users) groups=100(users), 101(administrators)...

Docker On Synology Nas

Docker - Portainer - Docker container managment made easy

This short article will be about Docker management. I meant to write it up sooner but always pushed it back because everything can be done using the command line. If you are into Docker or just starting, you will know (or soon find out) that it...

Docker - Portainer - using stacks (docker-compose)

Back in September 2020, I wrote a short article on how to get Portainer up and running as well as connecting it with multiple Docker hosts using the Portainer agent. With that article, you have all you need to get up and running. In this...


Comments are closed.