adds ci-cd and Docker container

This commit is contained in:
Seraphim Strub 2023-01-26 22:06:58 +01:00
parent 2a3ec00b58
commit 29550290d2
2 changed files with 47 additions and 0 deletions

20
Dockerfile Normal file
View file

@ -0,0 +1,20 @@
FROM golang:latest as builder
ARG GO_CMD=funbot
ENV CGO_ENABLED=0 \
GOARCH=amd64 \
GOOS=linux
WORKDIR /app
ADD . /app/
RUN go build -ldflags "-s -w -extldflags '-static'" -o /main ./cmd/${GO_CMD}/
FROM scratch
COPY --chown=65534:0 --from=builder /main /
USER 65534
WORKDIR /
CMD ["/main"]