6 ms·
> Should I have two separate docker images, one running the application and the other running MySQL, with them talking to each other across the host OS? Yes.
by Kudos 11y ago
> Should I have two separate docker images, one running the application and the other running MySQL, with them talking to each other across the host OS?
Yes.
> Or can they be configured in a single docker image?
They can, but it's an anti-pattern and there are hurdles to overcome if you try managing processes using an init system.
- msravi 11y agoThanks. Any idea about this? > ...if my application creates a fork(), will the container be unable to handle scheduling of the additional process?
- Kudos 11y agoForking works fine.
- msravi 11y agoHmm... if there's no kernel, who manages the process scheduling?
- stephenr 11y agoIt uses the host OS kernel, which is why its limited to a subset of Linux host machines. Honestly Docker is the epitome of the incorrect understanding of "DevOps".
- patrickaljord 11y agoThere is a kernel, Docker uses the host's kernel it runs on.
- nileshtrivedi 11y agoPeople differ on this point. Discourse, for example, ships a single Docker container which runs the Rails-based webapp, a database server (PostgreSQL), and a key-value store (Redis). They have been using this same setup in production for quite a while now.
- cmelbye 11y agoSo how do they run multiple application servers to scale horizontally? Or a cluster of Redis servers?