I have a dump.sql file that I would like to load with docker-compose.
docker-compose.yml:
services: postgres: environment: POSTGRES_DB: my_d
CONTAINER_NAME="postgres" DB_USER=postgres LOCAL_DUMP_PATH="..." docker run --name "${CONTAINER_NAME}" postgres docker exec -i "${CONTAINER_NAME}" psql -U "${DB_USER}" < "${LOCAL_DUMP_PATH}"