I’ve followed each step of part 1 chapter 4 and literally copy pasted the code as shown.
docker-compose is able to build the containers but I always get the Waiting for PostgresSQL to become available being logged from all the other containers as shown below. docker-compose logs
Following is the output of docker ps -a. From which I can see that all containers are running in their respective ports.
docker ps -a logs
I checked the docker container logs of the db and it shows to be running.
postgres container logs
But, I’m unable to open the Django server on port 8010 nor able to view the flower server on port 5557 because in the container logs I’m getting the message "Waiting for PostgreSQL to become available…"
Someone please help. This issue is killing me. I’ve tried to view the logs of each container and it’s showing it’s running, yet I’m not able to view the Django and flower server.
Let me know if you guys need more info.
Thanks!
Tried checking if the DB is up and running at the correct port.
checked if Redis is running.
checked the logs of each running container which points to the same message "Waiting for PostgreSQL to become available…"
2
Answers
psycopg2-binary package was used.
Using psycopg2 instead worked for me.
This issue maybe related to Mac M1
I had the same problem with this tutorial (on mac M1) and it took me many hours. The solution for me was finally to use "alpine" instead of "buster", here is my Dockerfile:
requirements.txt:
And may not directly related, I added start and health checks to the docker compose file, so you don’t need the postgres "ready" polling in the entrypoint script.
Here my docker-compose.yml: