|
|
|
|
|
by thu
4532 days ago
|
|
Yes you can but I don't think that's the philosophy behind Docker. To expand on the "dependencies" idea of my previous post, although you technically can put a process supervisor, a web server, an application server, and a database in the same container, this is not the best practice. It makes your app simpler to distribute (a single image, no orchestration) but harder to evolve (e.g. move the database to its own physical server, or replicate it and put them behind a connection pooler). For instance if you have a tool to manage a cluster of containers, you will be able to manage the different processes/containers logs in a repeatable way. But sure, if you know you don't need the added flexibility, you can put everything you want in the same image. |
|
Seems like the "docker way" is the one-process-image. But one use-case that I find entertaining is to use docker as an super simple way of trying out software. For example I ran Wordpress for 10 minutes just to check it out. In that case it makes sense to have everything in one container as it makes it much easier to run. But in production it might not be a good idea, especially if the app is not totally self contained.