For those who come across the same problem, here’s a short summary:
- Make sure your app is bind to
::
instead of0.0.0.0
. In my case, I had to specify::
in Dockerfile for my python app like so:
FROM python:3.10-slim-bullseye
ENV PYTHONUNBUFFERED True
ENV APP_HOME /app
WORKDIR $APP_HOME
COPY . ./
RUN pip install --no-cache-dir -r requirements.txt
CMD ["uvicorn", "main:app", "--host", "::", "--port", "8080"]
- If you’re using http clients like
Req
orFinch
, make sure you explicitly enableinet6
because Fly uses IPv6 for private apps [1].
> req = Req.new(url: "http://private-app.internal:8080", connect_options: [transport_opts: [inet6: true]])
[2][3]
- Make sure to connect over plaintext http [4].
And boom! Problem solved!
References