0

On Heroku I'm trying to release a pushed image as described here: https://stackoverflow.com/a/50788844/2771889

docker build --file Dockerfile.prod --tag registry.heroku.com/my-app/web .
heroku container:login
docker push registry.heroku.com/my-app/web
heroku container:release web

My heroku.yml looks like this (used when I deploy from GitHub, and works fine):

build:
  docker:
    web: Dockerfile.prod
release:
  image: web
  command:
    - yarn typeorm migration:run && yarn console seed
run:
  web: yarn start:prod

It seems that the run command is not taken into account. When running container:release the logs show:

Starting process with command node

Whereas during a release from GitHub I'd see the correct command:

Starting process with command /bin/sh -c yarn start:prod

The release command however is recognized and executed correctly.

How can I make sure container:release runs the container with the correct command?

thisismydesign
  • 21,553
  • 9
  • 123
  • 126
  • random thought.. did you try adding "image: web" to the run command? – sur.la.route Jun 04 '21 at 13:27
  • Where? I'm running `heroku container:release web`, which recognizes the correct image (and also runs the release command). – thisismydesign Jun 04 '21 at 15:39
  • Try adding it to your run section. In the `release` section you have a line `image: web`. Try to copy that line into the `run` section as well.. it doesn't know where to run the command at. – sur.la.route Jun 04 '21 at 18:18

1 Answers1

0

I had to add a CMD to my Dockerfile:

# ...

CMD yarn start:prod

This doesn't break GitHub deployments with heroku.yml.

thisismydesign
  • 21,553
  • 9
  • 123
  • 126