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 root = true
[*] [*]

2
.envrc
View file

@ -1,5 +1,3 @@
# SPDX-License-Identifier: GPL-3.0-or-later
# https://github.com/direnv/direnv/wiki # https://github.com/direnv/direnv/wiki
use flake 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 - stylesheets/extra.css
copyright: > copyright: >
Copyright © 2023 Copyright © 2023 Curious Community Labs e. V.

View file

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