I am trying to deploy a Go app. I’ve look through the guides and some questions here but I’m still stuck. I’m likely missing something relatively simple, but I need help from the community.
I have a Go project with the following basic folder structure
project/
--api
--- main.go
--- routes.go
--- handlers.go
--- helpers.go
--docs
--- Hugo Project with static site built to 'public' folder
go.mod
go.sum
Dockerfile
I keep running into an error with Docker saying there are no .go files.
Here is what I have for Dockerfile. What am I missing/doing wrong?
FROM golang:1.20
WORKDIR /app
COPY go.mod ./
COPY go.sum ./
RUN go mod download
COPY /api ./
# COPY /docs/public ./
RUN go build -v -o ../project
CMD [ "./project" ]