Docker-compose.yml or Dockerfile?

None of them builds images. Both files are just configurations. Dockerfile is to define the Docker image that you want to build. The compose file is to define the containers/services and you can refer to a Dockerfile if you want to run a container from an image that does not exist yet.