I finally found the culprit! Thanks to this thread and @ignoramous!
In my Dockerfile, I need to bind to ::
instead of 0.0.0.0
, 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"]