minimal go backend w/ dockerfile

This commit is contained in:
2024-08-02 20:52:42 +03:00
parent 6491f2b547
commit ded3b78c58
4 changed files with 37 additions and 0 deletions

12
backend/Dockerfile Normal file
View File

@@ -0,0 +1,12 @@
FROM golang:1.22
WORKDIR /usr/src/app
# pre-copy/cache go.mod for pre-downloading dependencies and only redownloading them in subsequent builds if they change
COPY go.mod go.sum ./
RUN go mod download && go mod verify
COPY . .
RUN go build -v -o /usr/local/bin/app ./...
CMD ["app"]