Running the Hiveeyes backend with Docker Compose

As I would like to run the Hiveeyes backend on-premises (besides pushing data to swarm.hiveeyes.org), I decided to create a docker-compose file to make starting up the whole stack more convenient: hiveeyes-backend-docker-compose

2 Likes

Finde ich gut!
Vielleicht kannst Du das in das vorhandene Dockerfile integrieren? Das hab ich mal gemacht, um die Firmware kompilieren zu können. Aber es schadet ja nicht, wenn das alles kann.

In welches Dockerfile sollte was genau integriert werden?

Hier im terkin. Liegt im obersten Verzeichnis.

ich bin mir gerade nicht sicher, ob ich es richtig verstehe, da ein docker-compose-File nicht in ein Docker-File integriert werden kann\sollte. Ich würde sagen, wenn man die Firmware kompilieren möchte, kann man einen Container vom Docker-File starten und wenn man das Backend hochfahren möchte, kann man docker-compose starten. Das sind zwei komplett unterschiedliche Ziele.

Es gibt auch schon ein docker-compose, das den ‘firmware container’ (der durch das Dockerfile definiert wird) startet.
Man könnte Deins und das Vorhandene zusammenwerfen, dann hat der Entwickler gleich alles beisammen.

1 Like

Brauche ich hier zusätzliche Rechte um meine Änderungen zu pushen?

$git push origin feature/hiveeyes-backend-docker-compose
ERROR: Permission to hiveeyes/terkin-datalogger.git denied to WSt89.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Ich denke ein pull request sollte gehe, fürs direkte pushen bräuchtest du tatsächlich edit-Rechte.

Danke, das ist der richtige Weg. Habe nun einen Pull Request erstellt, siehe Add docker-compose configuration for Hiveeyes backend by WSt89 · Pull Request #82 · hiveeyes/terkin-datalogger · GitHub.

1 Like

Hallo Werner,

entschuldige bitte auch hierzu die späte Antwort. Vielen Dank für den exzellenten Beitrag!

Was hältst Du davon, wenn wir diesem Code ein separates Repository spendieren, wie bei Add docker-compose configuration for Hiveeyes backend by WSt89 · Pull Request #82 · hiveeyes/terkin-datalogger · GitHub beschrieben? Zum Beispiel hiveeyes/hiveeyes-backend-docker?

Viele Grüße,
Andreas.

Oh, it actually was a separate repository:

I see. Is it reasonably up to date? Why not keep it like that?

Hallo Werner,

Vielen Dank! Wir haben die Umgebung ein wenig aktualisiert und verbessert und dem README ein paar einfache Beispiele zum “schnell Loslegen” hinzugefügt.

Wir haben die Änderungen auch bei Dir eingereicht, siehe Modernize environment, fix Mosquitto configuration and update README by amotl · Pull Request #2 · WSt89/hiveeyes-backend-docker-compose · GitHub, Dich aber auch wiederum als Teilnehmer bei o.g. Repository eingeladen.

Herzliche Grüße,
Andreas.

P.S.: Auf den MQTT Broker darf nun in der Standardkonfiguration anonym zugegriffen werden. Um ihn wieder so zu konfigurieren, wie von Dir vorgesehen, kann man der Dokumentation bei Lock down MQTT broker folgen.

1 Like

Hi,
I recently tried to get this backend up and running, but failed miserably. This is close to my first use of Docker Compose (I need good instructions) and I probably lack something quite simple but can’t figure it out. I tried to run on an AWS EC2 server running Debian 10 and consistently get an issue initially with Grafana as below, but then for other components. As suggested in the error log, I think I have a permission error, but the help did not seem relevant to me. I also tried Ubuntu on AWS and in a parallels Virtual Debian build with the same results, so I am consistent :slight_smile: Any help appreciated

Cheers
Michael

the end result is


a little later

Dear Michael,

thanks for your report. What happens if you follow the instructions at GitHub - hiveeyes/hiveeyes-backend-docker: Hiveeyes Backend in a box 1:1? Maybe perform these steps on your workstation first, before deploying to AWS?

With kind regards,
Andreas.

UPDATE: I ran in Docker Desktop on my Mac all good thanks so something to do with those other services. I will keep googling to find a solution.

Andreas,

Thanks for the fast response. I believe I have followed those instructions exactly on the EC2 servers and the virtual in parallels.

My MacBook is not the place for home-brew installs and such locally but if you think that is my issue I can try and setup on an old laptop.

Cheers

Michael

Dear Michael,

I believe it worked the last time on my macOS workstation and we got no other feedback about this yet, so I am happy you are looking into this topic. I will try to exercise it on a Ubuntu 20.04 LTS Focal Fossa or Debian 11 bullseye machine and let you know about the outcome.

With kind regards,
Andreas.

1 Like

Dear Michael,

I can confirm the same faulty behavior when running on Debian 11 through Vagrant.

$ docker-compose --file=docker-compose-standard.yml up
Starting vagrant_mosquitto_1 ... done
Starting vagrant_influxdb_1  ... done
Starting vagrant_grafana_1   ... done
Starting vagrant_kotori_1    ... done
Attaching to vagrant_mosquitto_1, vagrant_influxdb_1, vagrant_grafana_1, vagrant_kotori_1
mosquitto_1  | 1636418250: Error: Unable to open log file /mosquitto/log/mosquitto.log for writing.
mosquitto_1  | 1636418250: Error: Invalid password hash for user kotori, removing entry.
grafana_1    | GF_PATHS_DATA='/var/lib/grafana' is not writable.
grafana_1    | You may have issues with file permissions, more information here: http://docs.grafana.org/installation/docker/#migrate-to-v51-or-later
grafana_1    | mkdir: can't create directory '/var/lib/grafana/plugins': Permission denied
grafana_1    | service init failed: failed to connect to database: failed to create SQLite database file "/var/lib/grafana/grafana.db": open /var/lib/grafana/grafana.db: permission denied

With kind regards,
Andreas.

1 Like

Hi again,

with the most recent updates [1], the errors are gone. Please let me know about the outcome for you after updating your working tree of the repository [2] accordingly.

Unless you are aiming to do telemetry with CSV data or LoRaWAN/TTN radio transport, you will probably be fine using the new evironment defined within docker-compose-standard.yml, which is a little bit more slim – we excluded PutsReq (together with MongoDB and Redis) within that environment definition.

With kind regards,
Andreas.


  1. Comparing 9e6655...develop · hiveeyes/hiveeyes-backend-docker · GitHub ↩︎

  2. GitHub - hiveeyes/hiveeyes-backend-docker: Hiveeyes Backend in a box ↩︎

1 Like