By Shaun
I am deploying a container to the App Platform as a web service.
If I deploy a pre-built image, the build is obviously skipped, and the deploy stage fails usually[^1] with:
ERROR failed health checks after 1 attempts with error Readiness probe failed: dial tcp 10.xxx.xxx.xxx:8080: connect: connection refused
If I deploy with a GitHub repo (the same Dockerfile), the build is obviously not skipped, succeeds, and the deploy stage succeeds.
The only thing I am left trying to debug is the externally built image is for the wrong platform, but DO recommends linux/amd64
which is what it is built for.
Repo: https://github.com/freeCodeCamp/exam-creator/tree/4713a42e8ba966307d8ab62986b489bf28cbe13d
[1]: Sometimes the deploy logs fail with just []
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hey Shaun,
I’ve seen this kind of thing happen before, and in most cases, it’s due to the container not exposing the right port or not listening on the expected interface.
App Platform expects your app to listen on port 8080
by default. If your app is using a different port like 3000
, either update the app to use 8080
or set the correct port in the App Platform settings under the “HTTP Port” field.
Also, make sure your app is binding to 0.0.0.0
and not localhost
, otherwise, the internal health checks won’t be able to reach it and the deploy will fail with that “connection refused” error.
Since the same Dockerfile works when App Platform builds it from GitHub, the image itself is probably fine. The issue is likely with how the externally built image behaves at runtime, maybe it’s starting too slowly or not binding properly. You can test this locally by running:
docker run -p 8080:8080 your-image
If it doesn’t respond there, it won’t work on App Platform either.
- Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.