How does cookiecutter django create database in docker container/image

565 Views Asked by At

How does running docker-compose -f local.yml up create the postgres database in the postgres container with configurations in .envs/.local/.postgres. I have looked through the Dockerfiles and cannot seem to find a command such as createdb except in the maintenance/restore file.

Cookiecutter-django: https://github.com/pydanny/cookiecutter-django

1

There are 1 best solutions below

1
On BEST ANSWER

The cookie cutter sets the environment variables which are then read by the Docker image. See Section How to extend this image > Environment Variables in the official docs: https://hub.docker.com/_/postgres