Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project stuck on "website-web-1 | Waiting for PostgreSQL to become available..." on M1 Mac #139

Closed
PGallace98 opened this issue Feb 2, 2023 · 4 comments
Assignees

Comments

@PGallace98
Copy link

What happened?

I've followed the steps described on the e-book "Build Blog With Wagtail CMS (4.0.0)" on my M1 Mac and when Dockerizing the project (Chapter 4) I start encountering this issue.

The docker image and container build just fine but when I run the docker-compose logs -f command I encounter this issue

Screenshot 2023-02-02 at 10 43 58 AM

Additional details

I've followed the steps correctly, and the Dockerfile, the entrypoint, the start and the docker-compose.yml all match the book.

With the exact same configuration on my Windows 10 PC I don't encounter any problems at all.

@michael-yin michael-yin self-assigned this Feb 3, 2023
@michael-yin
Copy link
Member

@PGallace98

Thanks for your report

When you develop on M1 Mac, could you update the posgres image to https://hub.docker.com/r/arm64v8/postgres/ which is Arm Docker images instead of default x86/amd64

Since I have no M1/M2 Mac in hand so I can not not test if it works, but I hope it can help.

Thx.

@PGallace98
Copy link
Author

@michael-yin

Thank you for the reply.

Unfortunately updating to postgres arm image didn't fix the problem.

docker-compose.yml file for reference

Screenshot 2023-02-03 at 3 00 00 PM

@michael-yin
Copy link
Member

michael-yin commented Feb 4, 2023

@PGallace98

I did some research on this issue and figured it out

Why this issue happen

On apple silicon, we got Postgresql SCRAM authentication problem? so the program hang with "Waiting for PostgreSQL to become available" message.

Solution

We can use Rosetta to make our program work with "linux/amd64" instead of the "arm64"

Below are the steps:

  1. Please remove all "docker containers" and "docker images" for a clean env. https://stackoverflow.com/questions/44785585/how-can-i-delete-all-local-docker-images
  2. Git clone the project again without modification.

And then run command below

# install rosetta
softwareupdate --install-rosetta

# tell docker to build and run on amd64 platform
export DOCKER_DEFAULT_PLATFORM=linux/amd64
docker-compose build
docker-compose up

I already tested it on real M1 Mac and it worked.

Thx

@PGallace98
Copy link
Author

Thanks a lot it worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants