May 18, 2024
Hi @Kevin, Are you sure keeping localhost in the database url like below works for docker-compose?
SQLALCHEMY_DATABASE_URL = 'postgresql://postgres:Bright#1270@localhost/fastapi'
Somehow it wasn't worked for me and tried multiple options, finally found that keeping localhost or IP address in the URL wont work for docker-compose file. Need to specify service name instead of localhost.
In your example service is name is db.
Please check and update.