Add elaborate Docker Compose instructions.
This commit is contained in:
parent
7b9f964950
commit
49f3396c10
1 changed files with 70 additions and 1 deletions
71
README.md
71
README.md
|
@ -6,7 +6,7 @@ Optionally, TimescaleDB can be used.
|
||||||
|
|
||||||
## Install instructions
|
## Install instructions
|
||||||
|
|
||||||
Docker is the preferred way to install OpenDTU Logger, but using the binary is also possible.
|
Docker Compose is the preferred way to install OpenDTU Logger, but using the binary is also possible.
|
||||||
|
|
||||||
### Docker
|
### Docker
|
||||||
|
|
||||||
|
@ -16,6 +16,75 @@ docker pull git.hollander.online/energy/opendtu-logger:0.0
|
||||||
|
|
||||||
Preferably, run the Docker image using the Docker compose examples provided in the `./docker` folder.
|
Preferably, run the Docker image using the Docker compose examples provided in the `./docker` folder.
|
||||||
|
|
||||||
|
#### Docker Compose
|
||||||
|
|
||||||
|
The `docker` folder in this [repository](https://git.hollander.online/energy/opendtu-logger) contains example Docker compose files. The `compose.with-database-grafana.yml` file contains a setup suitable for a complete deployment.
|
||||||
|
|
||||||
|
To use it, take the following steps
|
||||||
|
|
||||||
|
Enter the `docker` folder
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cd docker
|
||||||
|
```
|
||||||
|
|
||||||
|
Copy `example.with-database.env` to `.env`. E.g.:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cp example.with-database.env .env
|
||||||
|
```
|
||||||
|
|
||||||
|
- Edit the `REMOTE_URL` to point to your OpenDTU.
|
||||||
|
- In `DB_URL` alter the `password` field. Set the same value in. `PG_PASSWORD`
|
||||||
|
|
||||||
|
Deploy the Docker containers by running the following command from the `docker` folder.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
docker compose -f compose.with-database-grafana.yml up
|
||||||
|
```
|
||||||
|
|
||||||
|
Docker should now start downloading the required containers and bring up OpenDTU Logger, TimescaleDB and Grafana. If everything seems ok, press `CTRL + C` to stop the containers. Next, execute
|
||||||
|
|
||||||
|
```sh
|
||||||
|
docker compose -f compose.with-database-grafana.yml up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
The `-d` flag ensures that the containers are started in the background, so you can safely close your terminal window. Containers running in the background can be stopped by running compose again with the `down` command.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
docker compose -f compose.with-database-grafana.yml down
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Setting up Grafana
|
||||||
|
|
||||||
|
Grafana should be available at <http://localhost:3000>.
|
||||||
|
|
||||||
|
The initial login username and password are `admin:admin`. After the initial login, Grafana will request you to change the password to something more secure.
|
||||||
|
|
||||||
|
##### Configuring the OpenDTU Logger data source
|
||||||
|
|
||||||
|
After logging in, go to `Connections` -> `Data sources` -> `Add new data source`.
|
||||||
|
|
||||||
|
- Under `SQL` select `PostgreSQL`.
|
||||||
|
- Change the following fields
|
||||||
|
- `Host URL`: `timescaledb:5432`
|
||||||
|
- `Database name`: `opendtu_logger`
|
||||||
|
- `Username`: `postgres`
|
||||||
|
- `Password`: The password you set in the `.env.` file in the previous step.
|
||||||
|
- `TLS/SSL Mode`: `disable`
|
||||||
|
- `TimescaleDB`: set the slider to `enable`
|
||||||
|
- Click `Save and test`
|
||||||
|
- You should get a green box with a `Database Connection OK` message.
|
||||||
|
|
||||||
|
##### Adding the OpenDTU Logger dashboards
|
||||||
|
|
||||||
|
Now that the data source has been configured, we can add our dashboards.
|
||||||
|
|
||||||
|
- Go to `Dashboards` -> `New` -> `Import`.
|
||||||
|
- Upload `PV.json` from the `grafana` folder in this [repository](https://git.hollander.online/energy/opendtu-logger)
|
||||||
|
- After uploading, Grafana requests you to configure a data source. Select the data source configured in the previous step. Click `Import`. The dashboard should now be ready.
|
||||||
|
- If you want more dashboards, import the other dashboards from the `grafana` folder as well, or create your own.
|
||||||
|
|
||||||
### Binary
|
### Binary
|
||||||
|
|
||||||
Go to the [releases page](https://git.hollander.online/energy/opendtu-logger/releases) and download the most recent stable release.
|
Go to the [releases page](https://git.hollander.online/energy/opendtu-logger/releases) and download the most recent stable release.
|
||||||
|
|
Loading…
Reference in a new issue