FullFact / health-misinfo-shared

Raphael health misinformation project, shared by Full Fact and Google
MIT License
0 stars 0 forks source link

Docker compose fails to connect to localhost #35

Closed dcorney closed 3 months ago

dcorney commented 3 months ago

Describe the bug

Running docker compose fails.

Solution seems to be to remove localhost from both image: lines in the compose.yaml (though this should be confirmed).

To Reproduce

Steps to reproduce the behaviour:

  1. run docker compose up -d
  2. Observe error:
    ✘ raphael_frontend_react Error Get "http://localhost/v2/": dial tcp [::1]:80: connect: connection refused                                                                                         0.2s 
    ✘ raphael_backend_flask Error  context canceled                                                                                                                                                   0.2s 
    Error response from daemon: Get "http://localhost/v2/": dial tcp [::1]:80: connect: connection refused

Expected behaviour

The docker image should start running

Additional context

See slack thread

ff-dh commented 3 months ago

So I've been working on this on the linked branch. It's an annoying series of events, but after figuring out the obvious, that the frontend runs outside of the container (somewhat annoying but that's how SPAs work) it's almost all working. The only issue I have is getting GOOGLE_APPLICATION_CREDENTIALS into the backend container so that it can actually talk to the vertex API and communicate with Gemini. I have an idea on how to do this but if anyone has any contributions that would be great.

Currently you can run the backend on main locally outside a container with i.e. USERS=dakota:dakota1 python3 -m raphael_backend_flask.app outside of a container so, that might just be fine for now?

andylolz commented 3 months ago

Currently you can run the backend on main locally outside a container with i.e. USERS=[…] python3 -m raphael_backend_flask.app outside of a container so, that might just be fine for now?

Nice – this is really useful.

I’ve scrapped my attempt at a dev server start script in #45, and have replaced it with some README instructions that includes this line.

andylolz commented 3 months ago

Closing this as resolved 🎉