I have 2 things : a neo4j database which is deployed on GCP compute engine at this IP bolt://35.241.254.136:7687
And I have a fastapi app that need to access to neo4j.
When I run the API server with uvicorn main:app --reload, all is working correctly. I can access my distant database.
However when I run the api with docker (docker run -d --name mycontainer -p 80:80 myimage), it's impossible to access the neo4j database and I have this error
ServiceUnavailable( neo4j.exceptions.ServiceUnavailable: Couldn't connect to 35.241.254.136:7687 (resolved to ('35.241.254.136:7687',)):
Maybe something is wrong, I don't know about docker.
Here is my dockerfile
FROM python:3.9
WORKDIR /code
COPY ./requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
COPY ./ /code/app
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "80"]