Container app-userportal-use2-dev_1_009f4051 didn't respond to HTTP pings on port: 8080, failing site start.

Paul Viet Truong 21 Reputation points
2022-09-01T16:27:16.42+00:00

I have an a App Service in Azure. I have deployed a container to it. The container is initialized but as when it's pinged on port 8080 it does not respond so the site stops and it starts all over again initializing and trying to ping port 8080.

In the configuration under General Settings the startup command is as follows:
pm2 serve build 8080 --spa --no-daemon
So I am telling it the destination folder and the port to serve it on.
In the configuration under Application Settings i added WEBSITES_PORT = 8080 and I added WEBSITES_CONTAINER_START_TIME_LIMIT = 400 to give it extra time. From what I understand WEBSITES_PORT should force the container to open on port 8080 to serve and the TIME_LIMIT gives it extra time to spin up.

None of this seems to be working and the only error I am getting is:
2022-09-01T15:44:59.620Z INFO - Initiating warmup request to container app-userportal-use2-dev_1_009f4051_middleware for site app-userportal-use2-dev
2022-09-01T15:45:15.439Z INFO - Container app-userportal-use2-dev_1_009f4051_middleware for site app-userportal-use2-dev initialized successfully and is ready to serve requests.
2022-09-01T15:45:15.560Z ERROR - Container app-userportal-use2-dev_1_009f4051 didn't respond to HTTP pings on port: 8080, failing site start. See container logs for debugging.
2022-09-01T15:45:15.570Z INFO - Stopping site app-userportal-use2-dev because it failed during startup.

the build is a simple npm build with a .env file. Nothing fancy here except some keys. From the error all i can tell is that it can't reach port 8080. I was told you have doing pm2 serve command with the port would take care of that. I was also told that Azure application settings override any docker settings anyway. I don't have a docker-compose file that sets anything; I just build and deploy it.

I am at a lost at what to do to resolve this issue.

Azure Container Instances
Azure Container Instances
An Azure service that provides customers with a serverless container experience.
645 questions
{count} votes

2 answers

Sort by: Most helpful
  1. rafalzak 3,216 Reputation points
    2022-09-01T19:25:12.6+00:00

    Hi @Paul Viet Truong ,

    Please check .env file and define PORT. Azure App Settings do not override docker settings. To point your app code to the right port, use the PORT environment variable.


  2. Paul Viet Truong 21 Reputation points
    2022-09-02T14:32:53.71+00:00

    So i wen tthrough the documentation and created a simple ecosystem.config.js file. one of the options asks for a script path. I don't see what script it wants. It's a simple React Node.js webapp. it has an index page. the only js files i have are in the /static/js/ folder. so i pointed it to there but it doesn't like it. The documentation for this script path doesn't give any information.
    script path relative to pm2 start

    my file:
    module.exports = {
    apps : [
    {
    name: "app-userportal-use2-dev",
    script: '/static/js/',
    watch: false,
    error_file:'./error.log',
    out_file:'./output.log',
    env: {
    "NODE_ENV": "development",
    "PORT": 8080,
    },
    }
    ]
    }

    0 comments No comments