H
H
Holmess882020-10-29 10:13:40
Docker
Holmess88, 2020-10-29 10:13:40

Why doesn't Docker-compose volume mount data from container to local machine?

Hello! Please tell me why this is happening.

I have three official builds - nginx, fpm, postgres. When I assemble containers from them, the volume on postgres completely from scratch creates a local folder with a database from the container, which I didn’t have before, and the rest of the volumes are just empty folders without data.

I want to have maximum control over ngix and php, so I listen to /etc/nginx and /usr/local/etc respectively. But unlike postgres, these folders from containers are created without data and, accordingly, delete nginx and php data in containers.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nird, 2020-10-29
@Nird_o

Probably because volumes forwards the local directory to the container, and not vice versa.

Z
zohan1993, 2020-10-29
@zohan1993

Similar
question
I gave examples

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question