├── nextcloud ├── db.env └── docker-compose.yml ├── .images ├── 02-certificate.png └── docker-compose-nas-01.png ├── librespeed └── docker-compose.yml ├── plex └── docker-compose.yml ├── unifi-controller └── docker-compose.yml ├── LICENSE └── README.md /nextcloud/db.env: -------------------------------------------------------------------------------- 1 | MYSQL_PASSWORD= 2 | MYSQL_DATABASE=nextcloud 3 | MYSQL_USER=nextcloud 4 | -------------------------------------------------------------------------------- /.images/02-certificate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonathanvansina/docker-compose-nas/HEAD/.images/02-certificate.png -------------------------------------------------------------------------------- /.images/docker-compose-nas-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jonathanvansina/docker-compose-nas/HEAD/.images/docker-compose-nas-01.png -------------------------------------------------------------------------------- /librespeed/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | 3 | services: 4 | web: 5 | image: adolfintel/speedtest 6 | ports: 7 | - 8082:80 8 | restart: always 9 | environment: 10 | - MODE=standalone 11 | - TITLE=Jette Speedtest 12 | -------------------------------------------------------------------------------- /plex/docker-compose.yml: -------------------------------------------------------------------------------- 1 | --- 2 | version: "2.1" 3 | services: 4 | plex: 5 | image: linuxserver/plex 6 | container_name: plex 7 | network_mode: host 8 | environment: 9 | - PUID=1026 10 | - PGID=101 11 | - VERSION=docker 12 | - PLEX_CLAIM= 13 | volumes: 14 | - /volume1/plex/library:/config 15 | - /volume1/plex/music:/music 16 | - /volume1/plex/tvseries:/tv 17 | - /volume1/plex/movies:/movies 18 | restart: unless-stopped 19 | -------------------------------------------------------------------------------- /unifi-controller/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3.7" 2 | services: 3 | controller: 4 | image: jacobalberty/unifi:latest 5 | init: true 6 | restart: always 7 | volumes: 8 | - /volume1/docker/unifi:/unifi 9 | environment: 10 | - TZ=Europe/Brussels 11 | ports: 12 | - "3478:3478/udp" 13 | - "6789:6789/tcp" 14 | - "8080:8080/tcp" 15 | - "8443:8443/tcp" 16 | - "8880:8880/tcp" 17 | - "8843:8843/tcp" 18 | - "10001:10001/udp" 19 | -------------------------------------------------------------------------------- /nextcloud/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | 3 | services: 4 | db: 5 | image: mariadb 6 | command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW 7 | restart: always 8 | volumes: 9 | - /volume1/docker/nextcloud_db:/var/lib/mysql 10 | environment: 11 | - MYSQL_ROOT_PASSWORD= 12 | env_file: 13 | - db.env 14 | 15 | redis: 16 | image: redis:alpine 17 | restart: always 18 | 19 | app: 20 | image: nextcloud:apache 21 | restart: always 22 | ports: 23 | - 8081:80 24 | volumes: 25 | - /volume1/docker/nextcloud:/var/www/html 26 | environment: 27 | - NEXTCLOUD_TRUSTED_DOMAINS= 28 | - MYSQL_HOST=db 29 | - REDIS_HOST=redis 30 | env_file: 31 | - db.env 32 | depends_on: 33 | - db 34 | - redis 35 | 36 | cron: 37 | image: nextcloud:apache 38 | restart: always 39 | volumes: 40 | - /volume1/docker/nextcloud:/var/www/html 41 | entrypoint: /cron.sh 42 | depends_on: 43 | - db 44 | - redis 45 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Jonathan Vansina 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Docker Compose files for Synology NAS 2 | A collection of Docker Compose files optimized for a Synology NAS. 3 | 4 | ## How to run docker-compose on your nas 5 | 6 | 1. Enable SSH on your NAS, you can follow [this guide](https://www.synology.com/en-global/knowledgebase/DSM/tutorial/General_Setup/How_to_login_to_DSM_with_root_permission_via_SSH_Telnet). Make sure you have admin rights to your NAS (sudo). 7 | 2. Connect to your Synology NAS over SSH. 8 | 3. Installing docker-compose is simple, follow [this official guide from Docker](https://docs.docker.com/compose/install/#install-compose-on-linux-systems). 9 | 10 | ## General info 11 | 12 | 1. Don't use the Docker UI in your Synology NAS, only use Docker or docker-compose over SSH. 13 | 2. It's easy to [bind mount](https://docs.docker.com/storage/bind-mounts/) Docker volumes with your Synology NAS, by this way it's easy to backup your volumes (for example with Hyper Explorer). 14 | 3. Bind mounting volumes is depented on your disk configuration. But if you have one volume, in the most cases this volume will be mounted on `/volume1/` on your NAS. 15 | 16 | ## Putting your Containers behind Synology built-in reverse proxy 17 | 18 | Synology NAS has a built-in reverse proxy. It's very easy to put a Docker container behind this reverse proxy: 19 | 20 | 1. Make sure you own a domain (ex. example.com) and you can edit the DNS records. 21 | 2. Follow the guide of your registrar and point an A-record to the public IP of your Synology NAS (if you have a dynamic IP, look to enable DDNS). 22 | 3. Go to the settings of your NAS and **Application Portal** - **Reverse Proxy** and create an entry. 23 | ![](.images/docker-compose-nas-01.png) 24 | 4. To obtain a certificate for this domain: 25 | 1. Go to **Security** - **Certificates** 26 | 2. Add the certificates for your created domain 27 | ![](.images/02-certificate.png) 28 | 29 | I use Let's Encrypt certificates and this is working perfect. 30 | 31 | 32 | ## Optimized docker-composes 33 | 34 | ### Ubiquiti Unifi Controller 35 | 36 | The UniFi® Software-Defined Networking (SDN) platform is an end-to-end system of network devices across different locations — all controlled from a single interface. 37 | 38 | The Docker image is [jacobalberty/unifi-docker](https://github.com/jacobalberty/unifi-docker). 39 | 40 | #### Notes: 41 | * You can run this with a seperate MongoDB container, see the README of [the image](https://github.com/jacobalberty/unifi-docker). 42 | * Sometimes after updates, Ubiquiti APs, can't find the controller anymore, there is a little trick for this: 43 | 1. Enable SSH access to your Unifi AP. 44 | 2. Execute this command on your Unifi access point 45 | ```bash 46 | set-inform http://ip-of-controller:8080/inform 47 | ``` 48 | See [this help page](https://help.ui.com/hc/en-us/articles/204909754-UniFi-Layer-3-methods-for-UAP-adoption-and-management) from Ubiquiti from more adopting options. 49 | --------------------------------------------------------------------------------