golifehk/Dockerfile
2022-09-15 00:05:24 +08:00

22 lines
442 B
Docker

FROM golang:1.19-alpine AS build
WORKDIR /app
COPY [ "go.mod", "go.sum", "./" ]
RUN go mod download
COPY "datasources" "./datasources/"
COPY "utils" "./utils/"
COPY *.go ./
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o /golifehkbot
FROM scratch
COPY --from=alpine:latest /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=build /golifehkbot /
WORKDIR /
CMD [ "/golifehkbot" ]