chore(build): add Dockerfile
This commit is contained in:
parent
790c5d1f13
commit
ab513af9b9
1 changed files with 21 additions and 0 deletions
21
Dockerfile
Normal file
21
Dockerfile
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
FROM golang:1.22-alpine3.19 AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY go.mod go.sum ./
|
||||
|
||||
RUN go mod download
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN go build -o yggdrasil .
|
||||
|
||||
FROM alpine:3.19 AS runtime
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN apk add --no-cache ca-certificates
|
||||
|
||||
COPY --from=builder /app/yggdrasil .
|
||||
|
||||
CMD ["/app/yggdrasil"]
|
||||
Reference in a new issue