-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Finishing MQTT integration #15
Comments
Yes, this is also what I understand to be best practice.
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. |
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. |
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. |
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 |
Thanks Glyn, |
Hey guys - nearly 1 Year has passed - have you meanwhile figured out a solution, cause i would like to use it (-; |
I'm personally running emoncms in 3 (or maybe 4) docker containers.
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 |
I've got this working here https://github.com/emoncms/emoncms-docker/pull/27/files |
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. |
Thanks @jamesfidell I'd be interested to hear more about your solution, would you be able to make a pull request with your implementation? |
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. |
I wanted to start a small discussion how the MQTT integration could completed. For receiving inputs through docker, the mqtt_input script has to run in the background, which means an additional process is required. I am quite new to docker but as far as I understand it best practice would be to have a single container for each service/process. I could think of using multiple approaches for integrating the MQTT service:
I think it would be good if it would be possible to start the mqtt service only if mqtt is also enabled in the settings. I am not sure if this is possible with all three proposed variants. Any opinions on my proposed variants? Are there other, maybe better way to solve this issue?
The text was updated successfully, but these errors were encountered: