unpoller_unpoller/init/synology-docker-compose
Justin Partain 17f9be2cf6
First Round Updates
Here are some of the higher-level, more basic updates that you guys mentioned so far:
- Added a small part about the `.env` file and what its for
- Changed the various references to directories from `grafana` to `unifi-poller` as the base
- Changed the user name to create in the GUI from `grafana` to `unifi-poller`. 
  - Thought this might be more streamlined(?)
  - Might want to look into changing that on the docker instructions, too, if we prefer this
  - You have to keep the `sudo id` bit later, as we can't tell the GUI to use a specific user ID.

Let me know what you think about these minor updates, here.
2020-08-13 20:40:44 -05:00
..
.gitignore Completed README 2020-07-31 14:31:33 -05:00
README.md First Round Updates 2020-08-13 20:40:44 -05:00
docker-compose.example.env Fixed Variables and Network Name 2020-07-31 01:16:53 -05:00
docker-compose.yml Fixed Variables and Network Name 2020-07-31 01:16:53 -05:00

README.md

Synology Docker Compose Example

This folder is an example docker-compose.yml file and a .env file for using docker through a Synology Server.

The .env file is a special environment/variable file that docker-compose automatically uses to make configuration of your containers easier.

Directions

First, create the directories where you want the containers to save everything. I use the same base directory for them, like: /volume1/Docker/unifi-poller, then inside the ./unifi-poller directory: ./grafana and ./influxdb.

NOTE: Its best to use the command line over SSH to create these directories, AFTER you have the root shared directory created. (Control Panel -> Shared Folder -> Create)

sudo mkdir -p /volume[#]/[Shared Directory]/unifi-poller/grafana
sudo mkdir -p /volume[#]/[Shared Directory/unifi-poller/influxdbx

Where /volume[#] is the volume number corresponding to your volumes in Synology; [Shared Directory] is the shared directory from above, and then create the grafana and influxdb directories.

You still have to do this prep work creating the unifi-poller user, which I'll re-iterate here:

#. Create a new user account on the Synology from the Control Panel: - Name the user unifi-poller - Set the password (you don't need to logon as unifipoller and change it) - Disallow Password Change - Assign them to the user group users - Give them r/w permission to the folder you created e.g. /docker/unifi-poller - Don't assign them anything else - the point of this user is for security's sake. #. SSH into your Synology #. Run the following command to find the PID of the user you created and set the variable GRAFANA_LOCAL_USERID in your .env file: - sudo id unifi-poller - GRAFANA_LOCAL_USERID=1026

##Variables

For all of the variables used in the docker-compose file, make sure to not only read over but make important edits to the docker-compose.example.env file. As well as making a copy and naming it .env`

For the /local/storage/location/ lines, change those to match your directories.

#influxdb
INFLUXDB_ADMIN_PASSWORD=changeme
INFLUXDB_LOCAL_VOLUME=/local/storage/location/influxdb

#grafana
GRAFANA_USERNAME=unifi-poller_username
GRAFANA_PASSWORD=changeme
GRAFANA_LOCAL_USERID=1026

UNIFI_PASS=set_this_on_your_controller
UNIFI_URL=https://127.0.0.1:8443