Docker never runs on Azure - Waiting for response to warmup request for container

I'm trying to deploy a dockerized app on Azure's App Service. I enter all the fields correctly, my image gets pulled, put I keep getting this error until something times out.

Waiting for response to warmup request for container -<container name > Elapsed time = 154.673506 sec

I did set WEBSITE_PORT 8080 (used by my app)

Here is the dockerfile

FROM google/dart

WORKDIR /app
ADD pubspec.* /app/
RUN pub get --no-precompile
ADD . /app/
RUN pub get --offline --no-precompile

WORKDIR /app
EXPOSE 8080

ENTRYPOINT ["pub", "run", "aqueduct:aqueduct", "serve", "--port", "8080"]

It was working fine. I had it working last night. I wanted to refresh my image so I restarted. Nothing worked. After multiple hours I deleted my app and started again... no luck. Any ideas?

EDIT 1: Tried changing port to 80, no luck (This was the port I was using at first when it was working fine)

RESOLVED (Partially)* I changed everything to port 8000. I realized that Linux and windows did not like having something non-system listening on 80. Therefore I changed everything on 8000 and set the system properties on Azure {WEBSITE_PORT, 8000}. IT now seems to work fine. I don't know if this is an official fix... But it does warmup after 30-ish seconds

Asked By: Etienne Berube
||

Answer #1:

Depending which App Service plan you have, if there is an option ‘always on’, try to set ‘always on’ in the configuration of your app in Azure portal.

If you are using a Premium App service plan, you can set pre-warm number of instances. Try to set that to 2-3 and see if it gets any better..here

I had the same experience as you, but my container was really big since it contained ML model, so at the end I switched to AKS because it performed better..

Answered By: Etienne Berube

Answer #2:

You can also try setting WEBSITES_CONTAINER_START_TIME_LIMIT to 1800

Answered By: kgalic

Answer #3:

what actually worked for me was a combination of the answers above by Ethiene and kgalic, setting all ports to 8000 in the docker file

EXPOSE 8000
CMD gunicorn -w 4 -b :8000 app:app

in the azure configuration application settings adding

"WEBSITES_PORT" : "8000" 

in the azure configuration general settings setting

"Always on" : "on"
Answered By: rpd

Answer #4:

App Service - Docker container deploy

In my case, this slowdown was caused by automatic port detection. Setting the WEBSITES_PORT in the application setting solved the problem.

WEBSITES_PORT=8000

Pay attention if you have more slots (production/staging?), you have to set this env variable in the other slots too.

From: Azure App Service on Linux FAQ - Custom Contaniers

We have automatic port detection. You can also specify an app setting called WEBSITES_PORT and give it the value of the expected port number. Previously, the platform used the PORT app setting. We are planning to deprecate this app setting and to use WEBSITES_PORT exclusively.

Answered By: Azaria Gebremichael
The answers/resolutions are collected from stackoverflow, are licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0 .



# More Articles