T
T
Tremo2017-03-04 12:05:10
Virtualization
Tremo, 2017-03-04 12:05:10

Do you use virtualization for more convenient work with multiple projects?

Good day!
At the moment, I am working on several projects at the same time.
Some projects require the use of python-a , some php, etc.
I would like to somehow separate them among themselves, and so that transferring the project to another server would be easier than configuring all the settings from scratch, as I do now.
Virtual machines consume a lot of resources, and moving a virtual machine to someone else's server is crazy :) I
looked in the direction of the docker, but I still don't quite understand how it works in an enterprise. Docker containers are only available to the host.
What do you use? why? and what are the benefits?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
D
de1m, 2017-03-11
@tremo0880

The docker is crying for you, it’s just for that and made. I understand that it is not immediately clear how to use it all.
I will explain to you with an example, here is an example. The container contains a program that is run by cron. Everything is already in the image except for three things - the cron configuration, the ssh key and the configuration for the program itself (which is already in the image).
That is, as you can see, there is a clear separation between the system and data. The system and programs are already ready, but they need data to work, which I add to them when I launch the container from this image.
Pay attention to the file "docker-compose.yml" (in addition to docker, you also need docker-compose to use it) it describes how the container should start.

volumes:
    - /nodejs/nodebackup/config.yml:/nodebackup/config.yml
    - /nodejs/nodebackup/id_rsa:/nodebackup/id_rsa
    - /nodejs/nodebackup/crontab.tmp:/crontab.tmp

Volumes says what data I want to add from my host to the container. That is, these three files about which I wrote are just located here. You can add not only files, but also folders.
In your case, you need to take a container in which there is a python, or make it yourself and, when starting the container, say that you want to mount the folder with your project to a specific place in the container.
On the plus side, it turns out that you do not need to do anything on the host, except for installing docker. When backing up, you only need to save data, if the project is in the git, then even it is not necessary to save it.

S
Sanes, 2017-03-04
@Sanes

I would like to somehow separate them among themselves, and so that transferring the project to another server would be easier than configuring all the settings from scratch, as I do now.

That's what configuration management systems are for. The simplest option, Ansible .

R
Rou1997, 2017-03-04
@Rou1997

I do not use any virtual machines, but I use VPS, where Windows Server is installed, thanks to which I work comfortably with a remote desktop, and do everything right there.
If not VPS, then again I work with the host, through what is - FTP, a file manager, some hostings have it, it's pretty good.

A
Alexander Chernykh, 2017-03-04
@sashkets

Virtual servers on esxi. The first is the database server. The second is a web server using third-party software + self-written junk 10 years ago, which does not work on php7* anymore and we will get rid of it in the future. The third is a web server with sites in Kohanoi, which is also generally subject to rewriting in Lara. The fourth is a web server with sites on the lara. Fifth - mailer

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question