updated dev env

This commit is contained in:
Sebastian Wendel 2023-02-07 16:55:21 +01:00
parent d8533366d2
commit 8c52396541
No known key found for this signature in database
GPG Key ID: 14ED8B1EC3371ECE
9 changed files with 86 additions and 10 deletions

View File

@ -1,5 +1,3 @@
# SPDX-License-Identifier: CC-BY-SA-4.0
root = true
[*]

2
.envrc
View File

@ -1,5 +1,3 @@
# SPDX-License-Identifier: GPL-3.0-or-later
# https://github.com/direnv/direnv/wiki
use flake

View File

@ -0,0 +1,7 @@
# IoT Platform
## Commands
```sh
docker-compose --file software/container/docker-compose.yml up
```

View File

@ -78,4 +78,4 @@ extra_css:
- stylesheets/extra.css
copyright: >
Copyright © 2023
Copyright © 2023 Curious Community Labs e. V.

View File

@ -6,13 +6,16 @@ with self.pkgs.${system};
[
# Development
editorconfig-checker
pre-commit
python310Full
yaml-language-server
esptool
micropython
nodePackages.node-red
openscad
micropython
esptool
pre-commit
python310Full
python310Packages.mkdocs
python310Packages.mkdocs-material
python310Packages.mkdocs-material-extensions
yaml-language-server
]
++ lib.optionals (pkgs.hostPlatform.system == "x86_64-linux") [
vscodium-fhs

View File

@ -0,0 +1,43 @@
version: '3'
services:
mosquitto:
# https://hub.docker.com/_/eclipse-mosquitto
image: eclipse-mosquitto:2.0
restart: always
ports:
- 1883:1883
influxdb:
# https://hub.docker.com/_/influxdb
image: influxdb:2.6
restart: always
ports:
- 8086:8086
grafana:
# https://hub.docker.com/r/grafana/grafana
image: grafana/grafana:9.3.6
depends_on:
- influxdb
restart: always
ports:
- 3000:3000
volumes:
- ${DATA_DIR}/grafana:/var/lib/grafana
- ../dashboard/flows.json:/data/flows.json
nodered:
# https://hub.docker.com/r/grafana/grafana
# https://nodered.org/docs/getting-started/docker
image: nodered/node-red:3.0.2
depends_on:
- influxdb
restart: always
ports:
- 1880:1880
environment:
- TZ=Europe/Berlin
- NODE_RED_ENABLE_PROJECTS=true
- FLOWS=flows.json
volumes:
- ../flow/flows.json:/data/flows.json

View File

27
software/flow/flows.json Normal file
View File

@ -0,0 +1,27 @@
[
{
"id": "f6f2187d.f17ca8",
"type": "tab",
"label": "MQTT2Influxdb",
"disabled": false,
"info": ""
},
{
"id": "ae14dbbaafe62be6",
"type": "tab",
"label": "CSV2Influxdb",
"disabled": false,
"info": "",
"env": []
},
{
"id": "3cc11d24.ff01a2",
"type": "comment",
"z": "f6f2187d.f17ca8",
"name": "WARNING: please check you have started this container with a volume that is mounted to /data\\n otherwise any flow changes are lost when you redeploy or upgrade the container\\n (e.g. upgrade to a more recent node-red docker image).\\n If you are using named volumes you can ignore this warning.\\n Double click or see info side panel to learn how to start Node-RED in Docker to save your work",
"info": "\nTo start docker with a bind mount volume (-v option), for example:\n\n```\ndocker run -it -p 1880:1880 -v /home/user/node_red_data:/data --name mynodered nodered/node-red\n```\n\nwhere `/home/user/node_red_data` is a directory on your host machine where you want to store your flows.\n\nIf you do not do this then you can experiment and redploy flows, but if you restart or upgrade the container the flows will be disconnected and lost. \n\nThey will still exist in a hidden data volume, which can be recovered using standard docker techniques, but that is much more complex than just starting with a named volume as described above.",
"x": 330,
"y": 100,
"wires": []
}
]