Just as a heads up we have an example for balena + electronJS that might help you if you hit any blockers.
I assume you’re running this as a multicontainer application type, then you could have the application server run as a separate container, which also has the nice benefit that updating it wouldn’t stop your frontend
I have the resin+Electron+React GUI application running ok in one container.
I was trying to add another application to this container (Python Server app) that will run in the background along with the GUI app.
But I can not make it work. Is this possible? I mean having 2 apps : one GUI and another like a server running together in the same container? or is necessary to create a docker compose to have a multi-container apps?
It should definitely be possible to run them alongside in the same container using something like http://supervisord.org
But yes the other option (and my personally preferred way of doing it - for the sake of maintainability) is to use docker-compose. You can follow our docs if for that as well: https://www.balena.io/docs/learn/develop/multicontainer/
@robertgzr,
Is possible to communicate data between 2 different container apps running in the same BalenaOS host?
If yes How? What is the best practice?
Also commenting more in the approach of running the GUI app and server app in the same container.
I have tried in my Dockerfile.template
…
…
CMD [“bash”, “/usr/src/app/start.sh”]
inside start.sh I have started both apps using a bash command like “gui_app && server_app” and vice versa but does not work.
How "supervisor: is different that just start both processes using a bash commandline?
Using supervisord basically just adds a bunch of features that make it more pain free to manage. Like being able to restart one of the processes, starting additional ones, etc.