No matter what I do I cannot get the f'ing 8080 port to work. I can't getting on Docker settings. It's absolute s'show.

Brian Cairns 1 Reputation point
2022-07-07T21:27:55.897+00:00

2022-07-07T21:18:56.439Z INFO - docker run -d --expose=8080 --name pffm_0_7a02a7a4 -e WEBSITES_PORT=3000 -e WEBSITE_SITE_NAME=pffm -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=pffm.azurewebsites.net -e WEBSITE_INSTANCE_ID=236005b4fa121d2ec1d057fc2b8f515f8157a0848d0d3db7ff656e97873bb77f -e WEBSITE_USE_DIAGNOSTIC_SERVER=True appsvc/node:16-lts_20220309.1 2022-07-07T21:18:56.456Z INFO - Logging is not enabled for this container.Please use https://aka.ms/linux-diagnostics to enable logging to see container logs here. 2022-07-07T21:18:59.622Z INFO - Initiating warmup request to container pffm_0_7a02a7a4 for site pffm 2022-07-07T21:19:01.837Z ERROR - Container pffm_0_7a02a7a4 for site pffm has exited, failing site start 2022-07-07T21:19:01.944Z ERROR - Container pffm_0_7a02a7a4 didn't respond to HTTP pings on port: 8080, failing site start. See container logs for debugging. 2022-07-07T21:19:01.962Z INFO -

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,999 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Eric Boyd 341 Reputation points Microsoft Regional Director
    2022-07-08T00:03:01.57+00:00

    The first thing I'd recommend is to verify and make sure your container is listening on port 8080.

    If that is correct, then Azure App Service will automatically detect and forward requests to 8080. If not, you can set the WEBSITES_PORT variable/setting to the correct port number. In that log, it looks like the WEBSITES_PORT is currently being set to 3000.

    Here's a couple of links to more details about this.
    https://learn.microsoft.com/en-us/troubleshoot/azure/app-service/faqs-app-service-linux#how-do-i-specify-port-in-my-linux-container-
    https://learn.microsoft.com/en-us/troubleshoot/azure/app-service/faqs-app-service-linux#do-i-need-to-use-websites-port-for-custom-containers-
    https://learn.microsoft.com/en-us/azure/app-service/configure-custom-container?pivots=container-linux#configure-port-number

    0 comments No comments

  2. ajkuma 28,036 Reputation points Microsoft Employee Moderator
    2022-07-11T18:32:27.917+00:00

    BrianCairns-3055, Just checking in to see if the previous post helped answer your question or point you in the right direction.
    To benefit the community find the right answers, please do mark the post which was helpful by clicking on Accept Answer’ & ‘Up-Vote’.

    As EricBoyd mentioned, looks like the app is listening on port 3000 but the container is waiting for http response on port 8080.

    If the issue still persist, App Service sets the environment variable PORT in the Node.js container, and forwards the incoming requests to your container at that port number. To receive the requests, your app should listen to that port using process.env.PORT.

    Please check this example:

    const express = require('express')  
    const app = express()  
    const port = process.env.PORT || 3000  
    
    app.get('/', (req, res) => {  
      res.send('Hello World!')  
    })  
    
    app.listen(port, () => {  
      console.log(`Example app listening at http://localhost:${port}`)  
    })  
    

    Furthermore, if the issue still persists, please review the docker.log:

    1.Navigate to your Web App in the Azure Portal, select App Service Logs.
    2.Enable Application Logging (FileSystem) with a retention period day (1), and press on Save.
    3.Request the site a couple of times.
    4.Navigate through Kudu site on: https://<sitename>.scm.azurewebsites.net/api/logs/docker
    5.Review first docker.log, to fetch more info/ pointers.

    Kindly let us know if you have any further questions on this specific topic, we would be more than happy to assist you.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.