The project consists of django + nginx + postgresql containers

Run indocker-compose -f dc.yml up -d --build

And every time after making edits to the django application, in order to apply them, I restart the build, but at the same time the DB container is rebuilt (or does it not work like that?), and the base becomes completely empty.

How can I do the right thing in order not to fill the database every time?

The same problem with static files, if they have changed or new ones have been added, you need to rebuild the container to add them.

nickwaze2021-09-24 05:54:24

The base should be either in a separate container with volume, or without a container at all

andreymal2021-09-24 06:11:19

show your dc.yml

asanisimov2021-09-24 06:15:20

@asanisimov dc.yml pastebin.com/pyWZFW5H Dockerfile pastebin.com/XuZf1uGn

nickwaze2021-09-24 07:01:28

@nickwaze so you have all volumes empty) volumes: postgres_data: static_volume: media_volume:

asanisimov2021-09-24 07:04:07