Add Dockerfile and build with GitHub Actions
This commit is contained in:
parent
1224498518
commit
5e3543c392
4 changed files with 50 additions and 0 deletions
12
Dockerfile
Normal file
12
Dockerfile
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
FROM golang:1.21-alpine
|
||||
|
||||
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"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue