export postgres database from docker container code example
Example 1: how to recreate postgres database in docker
docker compose down
docker compose up --force-recreate
Example 2: docker create postgres db
# inside Dockerfile
COPY your_sql_file.sql /docker-entrypoint-initdb.d/