ADD env variables to db container

FIX Error: Database is uninitialized and superuser password is not specified.
Env vars needs to be defined in both the "db" and "web" containers 
In "db", so it can create the default user from it
In "web", so it can be used in settings.py to connect django to the postgres container
This commit is contained in:
Roldel 2022-01-03 06:06:02 +00:00 committed by GitHub
parent 5be8884def
commit e9d0a55d28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -75,6 +75,10 @@ and a `docker-compose.yml` file. (You can use either a `.yml` or `.yaml` extensi
image: postgres
volumes:
- ./data/db:/var/lib/postgresql/data
environment:
- POSTGRES_NAME=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
web:
build: .
command: python manage.py runserver 0.0.0.0:8000