Answer the question
In order to leave comments, you need to log in
Docker in production, how to organize the work of several projects?
Hey!
I have a need to support 10 +- projects on one debian server. Currently using nginx/php/python/mariadb, gitlab and jenkins for ci. I wanted to try docker, but I don’t have a very good idea of the organization yet, but first it’s like this: one container for nginx, one for db, and php / python projects - each in a separate container. It would not be desirable to start a separate container with db for each project.
So far, I have little idea how to make friends with each other, so I ask you to help with advice where to dig:
1. How is it more correct and more convenient to organize this entire zoo in terms of ease of support? An important point - sometimes it is necessary to raise some other application and I really don’t want it to take a lot of time.
2. Ideally, I would like to have everything the same, but in containers and with continuous integration via gitlab + jenkins. I can imagine how it should work in theory, but I haven’t seen smart mans.
Thank you all in advance. And I apologize if the questions are obvious enough.
Answer the question
In order to leave comments, you need to log in
Add to CI the stage of building and delivering the container by hook to the repository.
Use ready-made systems to manage all this economy.
Flynn.io for example is one-piece, uncomplicated.
If you are on the same server - that is even easier. Doc, for example.
Given
a host for projects.
DB container is one piece. Although I would take on each project separately. So it's easier to steer the rights to the base.
According to the image for each environment. (php, python). Updating the code via git. Database update through migrations.
1. Run jwilder/nginx-proxy on the host to quickly add new projects with domain binding and install python on the host.
2. We make a docker-compose file in the root of the project to deploy the project infrastructure. (Containers with environment and nix)
3 write ansible project update script (git pull, start migration, restart compos)
4 we collect the container with gitlab runner in which ansible is installed and keys for the host are added. We define for gitlab_ci for let's say the master branch after the tests launches ansible
5 Profit
Why jenkins? For him, point 4 is the same.
P.s build your containers on alpine and do docker squash
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question