Hey folks! I'm eager to integrate Docker into our work setup but I'm a bit perplexed about the best way to structure our architecture using containers. I'm new to Docker and could really use some guidance from those more experienced.
We have a system comprising several executables. There's a main executable that acts as a Windows service, which monitors a database. Based on specific commands or triggers set in that database, it launches other executables with defined command line parameters.
How should I organize this in containers? I know the database should be in its own container, but should each executable have its own container as well, or is it okay to group them? I've read that each process typically runs in a separate container, but I'm uncertain in this case since one process spawns the others continuously.
Thanks a ton for any help!
4 Answers
One effective way would be to treat each command-line tool as a separate service. You'll need to adapt the executables so they can run their own HTTP servers and accept parameters via an API instead of just starting with command line arguments. This setup lets you deploy each service in its own container easily. Alternatively, you could create a single service that integrates all the CLI tools and exposes an API for each. This way, each tool becomes a resource and you can send options with the payload or as HTTP parameters. In both scenarios, it’s crucial to think of your CLI tools as services. Just keep in mind that spawning containers from within another container isn't best practice.
Honestly, just put them all in one container! The guideline about one process per container mainly aims to prevent the use of process supervisors like s6 in your container. In your case, since the main app manages the subprocesses, it makes sense to keep everything within the same container as it already handles signals and errors appropriately.
Yeah, I'd be cautious with Windows applications in Docker. From my experience, it can get really complicated, and there’s a lot fewer resources compared to Linux containers. Make sure to explore if there's a Linux equivalent or port for your main executable for smoother integration.
By the way, since your main executable runs as a Windows service, is it available on Linux? Docker for Windows applications can be a real hassle and not that common, so just checking!
Related Questions
Can't Load PhpMyadmin On After Server Update
Redirect www to non-www in Apache Conf
How To Check If Your SSL Cert Is SHA 1
Windows TrackPad Gestures