I have a docker-compose.yml
which I am using to deploy to a remote host from my local (Mac) machine using docker context
. The compose config is as follows:
database:
image: postgres:14.2
restart: on-failure
volumes:
- ./db-data:/var/lib/postgresql/data
environment:
POSTGRES_DB: db
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
In order to persist data, I have defined a volume ./db-data:/var/lib/postgresql/data
. This db-data
folder does not exist in my local machine. I want delete this mount completely because I don't want any of the previously persisted data. I know I can define a new volume directory but I would like to use the same directory name (db-data
). I have tried the following:
docker compose down --volume --remove-orphans
- when I recreate new container, previously persisted data still exists- There is no folder called
./db-data
in my Mac working directory. - I tried searching
var/lib/docker
in my Mac. But that directory does not exists. - Docker for Mac app doesn't list any volumes
- There is no
db-data
in the remote host where the database is deployed