W
W
WhiteJamer2019-11-01 16:04:04
Docker
WhiteJamer, 2019-11-01 16:04:04

Docker development inside a container?

I studied the docks and read a lot of articles, but did not understand how to make changes to the project when the container is running, which inside it runs nginx with my conditional project on localhost
How do I continue development so that I can see changes in real time at localhost and most importantly, how to make them at all so that changes from the host machine are transferred to the docker container without restarting the container itself?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Nikolaev, 2019-11-01
@Whitejamer

how to make changes to the project while the container is running

Link the directory in the project folder with the directory in the docker container. If you are using docker-compose, then it is done like this:
version: '3.4'
services:
  app:
    volumes:
      - ./app:/app/app
      - ./frontend:/app/frontend

In my example, all changes in the /app directory will be pulled into the /app/app directory of the docker container; and all changes in /frontend - in the /app/frontend directory, respectively.
For docker itself, it is done in much the same way, I don’t remember the specific command.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question