How to Set Up Docker for Multiple Executables in a Service Architecture?

0
11
Asked By TechWhiz99 On

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

Answered By CodeCrafted42 On

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.

Answered By ServerSavvy88 On

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.

Answered By DockerDudeX On

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.

Answered By DevDynamo07 On

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

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.