golifehk/Dockerfile

24 lines
490 B
Docker
Raw Normal View History

2022-09-14 15:40:51 +00:00
FROM golang:1.19-alpine AS build
2022-09-14 15:21:27 +00:00
WORKDIR /app
COPY [ "go.mod", "go.sum", "./" ]
RUN go mod download
COPY "datasources" "./datasources/"
COPY "utils" "./utils/"
2022-09-16 21:58:52 +00:00
COPY "query" "./query/"
COPY "i18n" "./i18n/"
2022-09-14 15:21:27 +00:00
COPY *.go ./
2022-09-14 16:00:45 +00:00
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o /golifehkbot
2022-09-14 15:21:27 +00:00
2022-09-14 15:40:51 +00:00
FROM scratch
2022-09-14 16:05:24 +00:00
COPY --from=alpine:latest /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
2022-09-14 15:48:00 +00:00
COPY --from=build /golifehkbot /
2022-09-14 15:40:51 +00:00
2022-09-14 16:00:45 +00:00
WORKDIR /
2022-09-14 15:21:27 +00:00
CMD [ "/golifehkbot" ]