T
T
topuserman2019-12-19 12:47:43
Docker
topuserman, 2019-12-19 12:47:43

Containerization for local development?

Hello everyone, we are developing an online store. We work according to the classical scheme, we have dev and production, we conduct all development locally.
The problem is this: the project is quite large, new developers are constantly appearing, and everyone needs to be explained that they need to install OpenServer, choose the desired configuration, a bunch of settings, etc.
Naturally, I wrote instructions, but I understand that this cannot continue, because. every new developer spends a couple of days setting up the environment.
We enjoy working on OpenServer because the file structure of the project is available right on our work computer, and any IDE can open the project without any problems.
I started reading about docker, I understand that this is what we need.
But there are many questions that I can’t find answers to: Do ​​I
understand correctly that docker can also be safely used locally on windows? How do you deploy docker locally?
When deploying a project through docker, some kind of virtualization is created. How then to work with the project through the IDE? If the whole project environment is on linux, and we work on windows, how do people work through the IDE in such cases?

Answer the question

In order to leave comments, you need to log in

6 answer(s)
A
Arman, 2019-12-19
@Arik

Do I understand correctly that docker can also be safely used locally on windows? How do you deploy docker locally?

you can, but it seems like on Windows, like on a poppy, everything is very slow, you have to use docker-sync.io
Rather, it will be not just "on linux", but on different linux, i.e. Database at home, web server at home, etc.
You need to smoke the dock in the mount section, if not, then all the files are in the main system (where the IDE is natural), and we mount the project folder in the necessary containers, where the web server, database, etc. already know what to do with these files

V
Vladimir Kuts, 2019-12-19
@fox_12

Do I understand correctly that docker can also be safely used locally on windows?

Yes. But there are some nuances. Docker is much easier to work with in a Unix environment.
via docker-compose:
Yes, everything is the same - your project folder is mapped into a container, and you can easily open it in your IDE.
The only thing is that there may be problems with debugging a project in the IDE.

V
vldud, 2019-12-19
@vldud

Do I understand correctly that docker can also be safely used locally on windows?
- right
How do you deploy docker locally?
- https://docs.docker.com/docker-for-windows/install/
How then to work with the project through the IDE?
- if we are talking about php, then PhpStorm integration is implemented and described perfectly
If the whole project environment is on linux, and we work on windows, how do people work through the IDE in such cases?
- here you will raise your linux environment in a docker container

A
Alexander Aksentiev, 2019-12-19
@Sanasol

this cannot continue, because every new developer spends a couple of days setting up the environment.

They also suddenly! You need to read the code before work.
Do you want that he solved the first problem an hour after getting a job?
And so if developers change so often and none of them can start a project without instructions, then the problem is not in the project setup time. You have some kind of juno-conveyor, apparently, and the project to start is something non-trivial.
you need to make the project so that it can be launched in principle without problems.
Instead of to start with certain configs on a certain software.
Not to mention those who sit on Linux or MacOS. You don't hire them?)
I use my own set of software for all projects locally and all developers work as usual.
And the docker is generally by development, I only keep bases on the local computer there.
During normal development, it’s inconvenient + eternal jambs with the speed of a disk in a docker on a poppy / Windows or something else.
In general, wildly uncomfortable.

S
Sergey Sokolov, 2019-12-19
@sergiks

Do I understand correctly that docker can also be safely used locally on windows?
Correctly.
How do you deploy docker locally?
For Mac or Windows, download Docker Desktop .
Expand the project - just like wrapping it) Most likely, clone the turnip with docker-compose.ymlyour project file and docker-compose up And then go inside the containers, or run additional temporary ones - with all sorts of git clone, composer install, npm i, mysql -p${MYSQL_ROOT_PASSWORD} < database_init.sql etc.
When deploying a project through docker, some kind of virtualization is created.
Not really. Docker is not virtualization, but containerization. There is no virtual machine, unlike, for example, VirtualBox. At the household level, there are some isolated virtual boxes-containers, from which, maybe, a port sticks out. And these boxes see each other as computers in the local network.
How then to work with the project through the IDE? If the whole project environment is on linux, and we work on windows, how do people work through the IDE in such cases?
Alternatively, work as a remote Linux server. Connect to it via SSH, the same VS Code can use the Remote-SSH extension .
Copy files from a computer to containers (or vice versa) via
docker cp ./local.file  containerName://var/www/remote.file

For the “luxury” of local-usual work with files directly on a computer with any IDE that any of the developers prefers, you will have to pay by screwing up configs that will differ from production. And then, probably, all the buzz of dockerization-for-development disappears.
In general, I would not recommend docker for local development, although I myself use it in some projects.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question