W
W
wiyod2018-02-24 21:16:50
Docker
wiyod, 2018-02-24 21:16:50

How to develop applications using Docker?

Ok, I see the benefits of Docker when deploying applications. And how to implement it in development?
I don't want to have 100500 dependencies on my local machine, so I use Docker. Launched the application, it works. But if I make some changes to the source code, the docker does not see it. And restarting the container does not help, you need to rebuild the entire image.
The question arises - what then to do with the docker at the development stage?
Ideally, run everything in containers - Monga, Node, Redis, etc., develop the application in this way.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
RidgeA, 2018-02-24
@RidgeA

But if I make some changes to the source code, the docker does not see it. And restarting the container does not help, you need to rebuild the entire image.

How do files get into docker? If you forward the folder (volumes), then there should be no problems (there may be some nuances with Windows, but this is not accurate).
If COPY / ADD - then yes, you need to rebuild the container.

A
Anton Shvets, 2018-02-24
@Xuxicheta

You mount the folder with your scripts on the host inside the container.
You also do npm install on the host (although you can, of course, attach inside the container and run it manually there). The node in the container simply works instead of the node on the host.
To return statics, I also keep nginx in the docker, which can proxy requests to a running webpack-dev-server (if it is used in development).
Mongu, radish - whatever. For development, it is convenient to keep them side by side in their containers, run everything at once with a docker compose.

Y
Yerlan Ibraev, 2018-02-26
@mad_nazgul

Generally a strange question.
Docker is not needed during code changes.
Those. you write as usual.
But for deployment for testing - yes.
Create a new container with your application.
It is tested, if there are errors, then the cycle is repeated.
Well, it shouldn't concern you too much.
Those. your task is to create a docker file that will be used to build the docker container with your application.
And CI / CD systems themselves must be deployed on the test and beyond.
In development, docker containers are only needed for third-party services.
Those. you pick them up in your car and work with them.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question