'Deploying Ghost blog container to Azure Linux app service - siteContainer x didn't respond to HTTP pings on port: 2368, failing site start

I have a Ghost blog app running on Azure app service for linux via Azure Devops CI/CD, however i am getting and error "Container x didn't respond to HTTP pings on port: 2368". The ghost docker image uses port 2368 internally. I've looked at multiple other answers for example, setting the WEBSITE_PORT in the app service configuration to 2368 to no avail. I've turned my app to use always on. Stack trace below:

App service log stream

2021-08-23T21:26:33.069Z INFO  - Starting container for site
2021-08-23T21:26:33.069Z INFO  - docker run -d -p 6923:2368 --name ghostblog_0_58744fad -e DOCKER_CUSTOM_IMAGE_NAME=index.docker.io/daniaal/ghost-azure:latest -e WEBSITES_ENABLE_APP_SERVICE_STORAGE=false -e WEBSITE_SITE_NAME=ghostblog -e WEBSITE_AUTH_ENABLED=False -e PORT=2368 -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=ghostblog.azurewebsites.net -e WEBSITE_INSTANCE_ID=a919dcd2e2e82205603b38a623bd495 -e NODE_OPTIONS=--require /agents/node/build/src/Loader.js -e JAVA_TOOL_OPTIONS=-javaagent:/agents/java/applicationinsights-agent-codeless.jar -e StartupBootstrapper=Microsoft.ApplicationInsights.StartupBootstrapper -e DOTNET_SHARED_STORE=/agents/core/store/lin -e DOTNET_ADDITIONAL_DEPS=/agents/core/additionalDeps index.docker.io/daniaal/ghost-azure:latest  

2021-08-23T21:26:33.069Z INFO  - Logging is not enabled for this container.
Please use https://aka.ms/linux-diagnostics to enable logging to see container logs here.
2021-08-23T21:26:40.036Z INFO  - Initiating warmup request to container daniaalghostblog_0_63564fad for site ghostblog
2021-08-23T21:26:55.460Z INFO  - Waiting for response to warmup request for container daniaalghostblog_0_63564fad. Elapsed time = 15.423351 sec
2021-08-23T21:27:10.918Z INFO  - Waiting for response to warmup request for container daniaalghostblog_0_63564fad. Elapsed time = 30.8816903 sec
2021-08-23T21:27:26.081Z INFO  - Waiting for response to warmup request for container daniaalghostblog_0_63564fad. Elapsed time = 46.0449998 sec
2021-08-23T21:27:41.517Z INFO  - Waiting for response to warmup request for container daniaalghostblog_0_63564fad. Elapsed time = 61.481109 sec
2021-08-23T21:28:05.577Z INFO  - Waiting for response to warmup request for container daniaalghostblog_0_63564fad. Elapsed time = 85.5403324 sec
2021-08-23T21:28:20.737Z INFO  - Waiting for response to warmup request for container daniaalghostblog_0_63564fad. Elapsed time = 100.7007148 sec
2021-08-23T21:28:36.257Z INFO  - Waiting for response to warmup request for container daniaalghostblog_0_63564fad. Elapsed time = 116.2210768 sec
2021-08-23T21:28:51.417Z INFO  - Waiting for response to warmup request for container daniaalghostblog_0_63564fad. Elapsed time = 131.381104 sec
2021-08-23T21:29:06.593Z INFO  - Waiting for response to warmup request for container daniaalghostblog_0_63564fad. Elapsed time = 146.5563648 sec
2021-08-23T21:29:24.228Z INFO  - Waiting for response to warmup request for container daniaalghostblog_0_63564fad. Elapsed time = 164.1920071 sec
2021-08-23T21:29:39.382Z INFO  - Waiting for response to warmup request for container daniaalghostblog_0_63564fad. Elapsed time = 179.3461223 sec
2021-08-23T21:29:54.689Z INFO  - Waiting for response to warmup request for container daniaalghostblog_0_63564fad. Elapsed time = 194.6528339 sec

2021-08-23T21:30:10.049Z INFO  - Waiting for response to warmup request for container daniaalghostblog_0_63564fad. Elapsed time = 210.0124273 sec

2021-08-23T21:30:25.353Z INFO  - Waiting for response to warmup request for container daniaalghostblog_0_63564fad. Elapsed time = 225.3171752 sec

2021-08-23T21:26:48.221093378Z [2021-08-23 21:26:48] [36mINFO[39m Ghost is running in production...
2021-08-23T21:26:48.238558204Z [2021-08-23 21:26:48] [36mINFO[39m Your site is now available on https://daniaal.com/
2021-08-23T21:26:48.239550511Z [2021-08-23 21:26:48] [36mINFO[39m Ctrl+C to shut down
2021-08-23T21:26:48.287893561Z [2021-08-23 21:26:48] [36mINFO[39m Ghost server started in 4.57s
2021-08-23T21:26:50.810708816Z [2021-08-23 21:26:50] [36mINFO[39m Database is in a ready state.
2021-08-23T21:26:50.812458329Z [2021-08-23 21:26:50] [36mINFO[39m Ghost database ready in 7.101s
2021-08-23T21:27:09.120040736Z [2021-08-23 21:27:09] [36mINFO[39m Ghost booted in 25.408s
2021-08-23T21:27:09.167540579Z [2021-08-23 21:27:09] [36mINFO[39m Adding offloaded job to the queue
2021-08-23T21:27:09.268183108Z [2021-08-23 21:27:09] [36mINFO[39m Scheduling job update-check at 31 7 1 * * *. Next run on: Tue Aug 24 2021 01:07:31 GMT+0000 (Coordinated Universal Time)


2021-08-23T21:30:30.461Z ERROR - Container ghostblog_0_58744fad for site ghostblog did not start within expected time limit. Elapsed time = 230.4251241 sec
2021-08-23T21:30:30.464Z ERROR - Container ghostblog_0_58744fad  didn't respond to HTTP pings on port: 2368, failing site start. See container logs for debugging.
2021-08-23T21:30:30.481Z INFO  - Stopping site daniaalghostblog because it failed during startup.
2021-08-23T21:31:57  No new trace in the past 1 min(s).

Dockerfile

FROM ghost:4.11.0-alpine

# copy config.production.json, contains storage config.
COPY config.production.json config.production.json

# Add necessary packages for Sharp to work. The library installed below uses sharp to resize images.
RUN apk add --update --no-cache gcc g++ make libc6-compat python3

# Install Azure Storage adapter
RUN npm install ghost-storage-azure
RUN cp -vR node_modules/ghost-storage-azure current/core/server/adapters/storage/ghost-storage-azure

I've tried everything but i think it has to be something to do with the ports but not sure.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source