How do you manage the variation between local and cloud dependencies within Docker?

Viewed 19

I have a Docker image with an application server running in it.

When I'm running in a development environment, I want to run a database server within the same Docker image.

However, in production, I want to use my cloud provider's database service to host my database server.

What is the best (preferably officially supported) way to enable this distinction?

1 Answers

You Don't

You don't run the DB in the same container. You run it in a separate container next to your application container (Probably with docker-compose, but not required)

You run the same version as the cloud provider (or as close as you can get because they will no doubt configure it specifically for their env)

Related