2

I have a project with two Dockerfiles in the same directory:

project
  /Dockerfile.web
  /Dockerfile.worker

I can use them to build different parts of the same project very easily with docker-compose. However, I struggle to tell heroku container:push that I want to use a custom Dockerfile. It seems I can only refer to custom directories to build.

Is there a solution to that?

adamsfamily
  • 1,746
  • 19
  • 37

1 Answers1

2

I found an answer to my question.

There doesn't seem to be a way to specify a custom Dockerfile name to heroku container:push.

However, as per documentation there is --recursive parameter for the heroku container:push command that does exactly what I needed:

Look for Dockerfile.web and build the web dyno:

heroku container:push web --recursive

Look for Dockerfile.worker and build the worker dyno:

heroku container:push worker --recursive

Look for both Dockerfile.web and Dockerfile.worker and build both dynos:

heroku container:push web worker --recursive
Hongbo Miao
  • 45,290
  • 60
  • 174
  • 267
adamsfamily
  • 1,746
  • 19
  • 37