Giter Site home page Giter Site logo

Comments (11)

janecker avatar janecker commented on August 15, 2024 1

Good point, did not think about that. That could be good solution and I played around with an new php 7 based container running the mqtt script. That seems to be working. I will try to polish this version in the upcoming days.

from emoncms-docker.

JumpMaster avatar JumpMaster commented on August 15, 2024 1

I'm personally running emoncms in 3 (or maybe 4) docker containers.

  • emoncms web app
  • mqtt server (shared with other system so not part of emoncms)
  • MariaDB
  • mqtt listener

I also followed the mantra of one process per container. It's a shame that both the mqtt listener and emoncms server both have a full copy of the code from GitHub.

I'll upload my code to GitHub later today.

It's a shame

from emoncms-docker.

glynhudson avatar glynhudson commented on August 15, 2024

as I understand it best practice would be to have a single container for each service/process

Yes, this is also what I understand to be best practice.

new container could be created that is added to the docker-compose. This would require an additional repository with its own Dockerfile

No, additional repository would not be required. Just a sub-folder in this repo. We already use docker-compose to bring up multiple containers e.g. web, db, and redis. Its just that for db and redis we just the off-the-shelf image without any customisation therefore dockerfile is not needed. See: https://nickjanetakis.com/blog/docker-tip-10-project-structure-with-multiple-dockerfiles-and-docker-compose

I think creating another php (not php-apache) container is the best way to run the MQTT service. The user could then choose to start this container or not depending if MQTT input is required. Although it would't use much resources.

from emoncms-docker.

mattiarossi avatar mattiarossi commented on August 15, 2024

Hi, I am picking up this enhancement request, as I am redeploying my monolithic emoncms install and would like to move it to docker composer.
I am ok with building an additional mqtt container if needed, but I am not sure how to tackle the phpmqtt_input task.
In theory it should go into another container, using php-cli as base image, but it would need to share the data volumes with the main web container for access to the timeseries data, and the locking could break when the underlying volumes are mounted on an nfs share (guess, my case)
Another possibility would be to spawn it in the existing web container, but it would break the 'one purpose per container' pattern
I think I will go the separate container, shared volumes way, but comments are welcome
Regards,
Mattia

from emoncms-docker.

glynhudson avatar glynhudson commented on August 15, 2024

Hi Mattia,

Thanks for your comment. After considering this issue we have created an all-in-on Emoncms docker based on the ubuntu image. This simplifies everything, even though maybe this is not docker best practice I think it's the way forward for deployment. Here is a development repo, it's not yet on docker hub. Please let us know how you get on with it: https://github.com/TrystanLea/emoncms-docker

from emoncms-docker.

mattiarossi avatar mattiarossi commented on August 15, 2024

Thanks Glyn,
I agree the monolithic solution simplifies things, that's where I am coming from, a single container with emoncms, mosquitto and redis, I don't think I want to keep going that way, for me emoncms is part of a broader home automation setup that includes openhab,node-red,influxdb, grafana, you name it ... and I am reworking all of it to use docker/docker-compose. Do I have gone the separate container way with shared volumes (mindful of all risks involved in flock() potentially misbehaving when accessing time series data).

from emoncms-docker.

haniham avatar haniham commented on August 15, 2024

Hey guys - nearly 1 Year has passed - have you meanwhile figured out a solution, cause i would like to use it (-;

from emoncms-docker.

TrystanLea avatar TrystanLea commented on August 15, 2024

I've got this working here https://github.com/emoncms/emoncms-docker/pull/27/files
Does that match your approach @JumpMaster ? any tips to improve?

from emoncms-docker.

jamesfidell avatar jamesfidell commented on August 15, 2024

I came to the conclusion that the web app and the script to subscript/publish to MQTT are so tightly coupled in terms of shared code and configuration that there's a fair case to be made for running them in the same container. I have therefore gone the route of using supervisord to start both Apache and the script. It seems to work fine so far, modulo the issues with the script and Redis.

from emoncms-docker.

TrystanLea avatar TrystanLea commented on August 15, 2024

Thanks @jamesfidell I'd be interested to hear more about your solution, would you be able to make a pull request with your implementation?

from emoncms-docker.

jamesfidell avatar jamesfidell commented on August 15, 2024

Sure, I'll try to sort something out. The files are in a bit of a mess at the moment as whilst I am using a Docker container for emoncms, I'm not using the database container (already have a database running elsewhere). I'll clone a fresh copy and tidy it all up for a PR once I have my new templates working.

from emoncms-docker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.