WARNING The app is not listening on the expected address and will not be reachable by fly-proxy.
You can fix this by configuring your app to listen on the following addresses:
- 0.0.0.0:8000
I’ve got this app set up just like another apps I have running on Fly that don’t have that warning. I’ve been pouring over this forum, but I haven’t found anything to help me fix this yet. I even tried destroying and re-launching the app. Same warning.
Relevant(?) parts of fly.toml
:
[env]
PORT = "8000"
[[mounts]]
source = "storage"
destination = "/mnt/storage"
[http_service]
internal_port = 8000
force_https = true
auto_stop_machines = false
auto_start_machines = true
min_machines_running = 0
[[statics]]
guest_path = "/code/static"
url_prefix = "/static/"
and Dockerfile
:
FROM python:3.11.3
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
RUN mkdir -p /code
WORKDIR /code
# install Git and Node
RUN apt-get update && \
apt-get install -y git && \
apt-get remove nodejs npm && \
apt-get install -y curl && \
curl -fsSL https://deb.nodesource.com/setup_18.x | bash && \
apt-get install -y nodejs
COPY requirements/requirements.txt /tmp/requirements.txt
RUN set -ex && \
pip install --upgrade pip && \
pip install -r /tmp/requirements.txt && \
rm -rf /root/.cache/
COPY . /code/
EXPOSE 8000
CMD ["/bin/bash", "-c", "npm i; npm run build; python manage.py collectstatic --noinput; python manage.py migrate --noinput; gunicorn --bind :8000 --workers 2 config.wsgi"]