12
votes

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

5
Only the one error log? The problem is not on the port.Charles Xu
Yeah, It runs fine locally, which is weird considering it was working fine before. Would you have any ideas what I could investigate?Etienne Berube
is the setting WEBSITE_PORT or WEBSITES_PORT ?Jose
setting the PORT variable to the deployed one solved for meJonathan

5 Answers

5
votes

You can also try setting WEBSITES_CONTAINER_START_TIME_LIMIT to 1800

enter image description here

4
votes

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.

enter image description here

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..

3
votes

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"
2
votes

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.

0
votes

I had this same problem when I used the nodejs application, so I did build the dist folder by npm build on the creation of the docker image, so it is part of the docker image rather than the docker cmd creating the build image on the initial execution of the app. Maybe the RAM and CPU wasn't enough for the npm build to happen at the initial runtime

enter image description here