Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"No command specified for process type web" on Heroku

Tags:

docker

heroku

I did heroku container:push web and it gives Your image has been successfully pushed. You can now release it with the 'container:release' command. Then I ran heroku container:release web and it says

No command specified for process type web

I also tried heroku stack:set container as suggested here but no change.

I have Profile as

web: gunicorn app:app --log-file=-

Not sure what's wrong and how to debug this. Any help is appreciated!

like image 502
Logan Yang Avatar asked Apr 30 '19 02:04

Logan Yang


2 Answers

Changing from ENTRYPOINT to CMD fixed this issue for me

like image 183
gatkin Avatar answered Oct 21 '22 20:10

gatkin


You need to have a CMD directive specified at the end of your Dockerfile.

Heroku is unclear on this in their documentation. I was able to get my container to run locally without a CMD directive, likely as you were. But if you read Heroku docs here or here you'll pick up that Heroku takes for granted that the Dockerfile will specify a CMD to run.

I read here that Heroku requires all images to have the CMD directive specified, but I couldn't find that explicitly in Heroku docs.

I had the same problem until I added the CMD directive at the end of my Dockerfile. I'm still working though what exactly I should put as my CMD directive but I no longer get the No command specified for process type web error.

Here's the Docker documentation on CMD: https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#cmd

like image 42
Spencer Avatar answered Oct 21 '22 21:10

Spencer