discordBots/Dockerfile

20 lines
389 B
Text
Raw Normal View History

2023-01-26 21:06:58 +00:00
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 /
2023-01-26 21:18:37 +00:00
COPY --chown=65534:0 --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
2023-01-26 21:06:58 +00:00
USER 65534
WORKDIR /
CMD ["/main"]