Getting a docker build ready for (Heroku) deployment?
For building docker image using docker-compose you can add build: field to the service you want to build and assign to it the path of the Dockerfile for example:

version: '2'
services:
  web:
    build: .
    ports:
     - "8080:80"
    volumes:
     - /project:/var/www/html


This example define a web service which:


Uses an image that’s built from the Dockerfile in the current directory.
Forwards the exposed port 80 on the container to port 8080 on the
host machine
Mounts the project directory on the host to /project inside the
container, allowing you to modify the code without having to rebuild
the image.


To build the image, simply issue the build command via docker-compose, as such: docker-compose build.