Docker Compose doesn't load .env file and incorrect DATABASE_URL configuration #588
Labels
complexity: moderate
Time needed to do this ticket will be moderate e.g. 1-2 days
docker
Concerns Docker containers
question / suggestion
Further information is requested
stale
This issue or PR is inactive.
state: approved
Ready to go. Not blocked or pending.
Overview:
There are two main issues in the current Docker setup:
.env
file is not being loaded, causing missing environment variables during runtime.DATABASE_URL
useshost.docker.internal:35000
, which leads to connection errors within the Docker network.These issues prevent the backend service from properly connecting to the PostgreSQL database when using Docker Compose.
Environment:
Actions Needed:
.env
file: Update thedocker-compose.yml
to include theenv_file
directive.DATABASE_URL
: Modify theDATABASE_URL
to use the correct hostname within the Docker network (db:5432
).Proposed Fix:
Load
.env
file:Add the following to the
api
service indocker-compose.yml
:Correct
DATABASE_URL
:Update the
DATABASE_URL
indocker-compose.yml
:DATABASE_URL=postgres://postgres:postgres@db:5432/bloom
The text was updated successfully, but these errors were encountered: