[Python] docker, waitress with flaskr [Errno 99] address not available

Discussão em 'Python' iniciado por Stack, Março 6, 2025.

  1. Stack

    Stack Membro Participativo

    I've got an Azure VM up with docker, Ubuntu 22, and netconfig ready and ports open in 5000-5005. When I'm trying to compose the app to check if it's properly deployed Im getting the following error:


    File "/usr/local/lib/python3.11/site-packages/waitress/server.py", line 78, in create_server last_serv = TcpWSGIServer( ^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/waitress/server.py", line 243, in init self.bind_server_socket() File "/usr/local/lib/python3.11/site-packages/waitress/server.py", line 364, in bind_server_socket self.bind(sockaddr) File "/usr/local/lib/python3.11/site-packages/waitress/wasyncore.py", line 374, in bind return self.socket.bind(addr) ^^^^^^^^^^^^^^^^^^^^^^ OSError: [Errno 99] Address not available
    ​

    My Dockerfile consist of:

    FROM python:3.11-alpine

    ENV FLASK_APP=flaskr ENV FLASK_ENV=production

    WORKDIR /app

    COPY requirements.txt requirements.txt COPY dockerstart.sh start.sh COPY Crypto/py-fhe /app/Crypto/py-fhe RUN apk add build-base python3-dev libffi-dev linux-headers net-tools wireless-tools gmp-dev mpfr-dev mpc1-dev RUN pip install --no-cache-dir --upgrade pip \
    && pip install --no-cache-dir -r requirements.txt \
    && pip install /app/Crypto/py-fhe

    COPY . .

    EXPOSE 5000 CMD ["./start.sh"]


    My docker-compose:

    version: '3'
    services:
    node-1:
    image: thing1
    ports:
    - "5002:5000"
    networks:
    - container_network
    environment:
    - PORT=5000
    node-2:
    image: thing2
    ports:
    - "5003:5000"
    networks:
    - container_network
    environment:
    - PORT=5000
    node-3:
    image: thing3
    ports:
    - "5004:5000"
    networks:
    - container_network
    environment:
    - PORT=5000
    node-4:
    image: thing4
    ports:
    - "5005:5000"
    networks:
    - container_network
    environment:
    - PORT=5000
    networks:
    container_network:


    requirements file:

    pyzmq~=25.1.2
    flask~=3.0.2
    phe~=1.5.0
    psutil~=5.9.8
    firebase_admin~=6.5.0
    damgard-jurik~=0.0.3
    waitress~=3.0.0


    and the dockerstart.sh script is just the starter for waitress:

    #!/bin/sh
    waitress-serve --call --host <<azure public ip>> --port=$PORT "flaskr:create_app"


    after the 4 nodes are ready, it should launch properly, but Im getting the above error in every node log, and obviously I cannot get into the deployed web, it gets stuck in a loading loop.

    Doesn't matter anything, cannot get into the page, and i dont know if im missing anything, or ive got a wrong port config in my vm. Any idea?

    Edit: Ive got a dns set up too, and ive also tried to run it into localhost, but nothing would work.

    Continue reading...

Compartilhe esta Página