Closed nrobert closed 2 weeks ago
@nrobert, I had a slightly different fix but same logic about the binding port.
Added the missing 80 in the bind
"""gunicorn.conf.py"""
import multiprocessing
max_requests = 1000
max_requests_jitter = 50
log_file = "-"
bind = "0.0.0.0:80"
timeout = 230
num_cpus = multiprocessing.cpu_count()
workers = (num_cpus * 2) + 1
worker_class = "uvicorn.workers.UvicornWorker"
Also:
# WebApp.DockerFile starting at line 21
&& pip install --no-cache-dir uvicorn gunicorn # added uvicorn and gunicorn instead of wsgi
COPY requirements.txt /usr/src/app/
RUN pip install --no-cache-dir -r /usr/src/app/requirements.txt \
&& rm -rf /root/.cache
COPY . /usr/src/app/
COPY --from=frontend /home/node/app/static /usr/src/app/static/
WORKDIR /usr/src/app
EXPOSE 80
CMD ["gunicorn", "app:app", "-c", "gunicorn.conf.py"] # edited this too and explicitly mentioned reference to gunicorn.conf.py
@nrobert, I had a slightly different fix but same logic about the binding port. Added the missing 80 in the bind
That's another way which is fine locally. I'm not 100% sure that it will work on an App Service on Azure (based on a few search, for example this: https://stackoverflow.com/a/12812895/3136339 and this: https://copyprogramming.com/howto/gunicorn-not-starting-on-port-80-but-starting-on-port-8000) but I haven't tested your option to ensure that it is the case
What's working for me is adding gunicorn to requirements.txt, and modifying the dockerfile CMD to
CMD ["gunicorn" , "-b", "0.0.0.0:80", "app:app"]
This works locally (docker run -it -d -p 8000:8000 myimagename
) and in a deployed app.
We're still fully validating this then will push the PR.
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.
Describe the bug I'm using the project with a basic implementation: Docker image built and pushed to Azure Container Registry, and Web app using this image. I've already used it in the past with success and this issue is new from last Friday's changes made to sue async in backend, especially this one: https://github.com/microsoft/sample-app-aoai-chatGPT/commit/28f962cd659a8a05b2bbb3e4ddf356ff521a1c30#diff-939de85f28dfc44a0fa2767f798f2025f68a4749b841d7ae2e37837d6f58b030
This issue is linked to #600 as the same initial error was faced, but is describing an additional issue after a workaround for #600 has been implemented (see step 5 below)
To Reproduce Steps to reproduce the behavior:
requirements.txt
file to avoid #600Expected behavior The web app should display the webchat
Screenshots The web app never launches. Logs from the web app indicate the following:
Configuration: Please provide the following Bug related to app startup and happens with any openAI model / chat history setup etc.
Additional context I find a solution but did not had time to create a good PR to push it (I'm leaving for 2 weeks in a few hours) - if it can help and has not been pushed / fixed, I will add it end of February.
The solution is to configure a port number (doc) by adding "WEBSITES_PORT" with value 8000 in the App Service configuration settings as it is the port where Gunicorn listens