Docker-Compose: Different Build Context Path and Dockerfile File Path

I was writing an application and I had to dockerize it.

I wrote a Dockerfile to build my application and run it. Things were OK when I ran it using docker command alone.

But I had to run the application using docker-compose. I wrote a docker-compose.yml file to build as well as run the application. Here I am going to show only a simple application for the demonstration. Following is my Dockerfile content.

FROM golang:alpine

--

--

https://initcodes.blogspot.com/

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store