How to deploy NodeJS application to Heroku using docker
Create a project in your local
Create simple NodeJS application
server.js
Write your docker file
Build the image on top of light weight linux (alpine) and install express.
Dockerfile
Login to heroku cli
Login to heroku container
Create target application
Connect you local git to remote heroku git
Build the image and push to Container Registry
Then release the image to your app
Verify the nodeJS application in your browser
Logout the container when you're done
You cannot deploy redis to heroku docker since they did not expose other ports.
https://stackoverflow.com/a/44548327/3117474
https://stackoverflow.com/questions/63229364/cant-connect-to-dockerised-redis-on-heroku
https://stackoverflow.com/questions/52814219/how-to-find-process-env-port-port-number-in-heroku
Last updated