diff --git a/backend/Dockerfile b/backend/Dockerfile index 99daaed..7f9c106 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,25 +1,18 @@ -# syntax=docker/dockerfile:1 - # Start from the latest golang base image -FROM golang:latest AS build +FROM golang:latest # Set the Current Working Directory inside the container WORKDIR /app # Copy everything from the current directory to the PWD inside the container -COPY . . +COPY go.* . # Download all the dependencies -RUN go mod download +RUN go mod download && go mod verify -# Build the Go app - change directory to 'cmd' where main.go resides -RUN go build -o /app/hello ./cmd +COPY ./cmd ./cmd -FROM alpine:latest - -WORKDIR /app - -COPY --from=build /app/hello . +RUN go build -v -o main ./cmd # Command to run the executable -CMD ["./hello"] +CMD ["./main"]