0

I'm planning to migrate my application stack to Docker. Let me describe the services I'm currently using:

  • HAProxy, which is used for SSL termination on all service's connections (HTTP and raw TCP connections), and forwards traffic to the services below.
  • Nginx, which serves static files, like updates and some information pages.
  • Node.js, which runs the main applications.
  • MySQL (MariaDB), the database used and shared by all the applications.

My question is about the database.

What's the proper way of running MariaDB in this case?

  1. Install and run it inside my container, along with the other services?
  2. Run the official image in a separate container, and link my container to it with the --link option of Docker's run command?

Does the first option have any disadvantage?

TeamSpeak docker container uses the second option and that's what made me question myself about the correct way of running the database in my case, but I particularly feel more inclined to package all the services inside my own image.

2
  • Please look at docker-compose which would fit your case. Commented Nov 15, 2016 at 7:36
  • Please explain why Docker is an advantage for any of the stack. (I'm not arguing against Docker, but rather hoping to derive an answer that addresses your needs.) Commented Nov 16, 2016 at 18:33

1 Answer 1

5

Docker Philosophy: Split your application into microservices and use a container for each microservice.

In your case, I recommend a MariaDB container, Using official (Library) Image gives you easier update management, but feel free to use your custom image.

An HAProxy Container, A nginx container and a nodejs container.

This way you divided your application into microservices, and you can upgrade, manage and troubleshoot them easier in an isolated environment.

If you are thinking about delivering your application to end users via docker, a simple docker-compose file will do the trick for easy launching the required containers.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.