From ad99028ffe9e5fb6c5a92b9a8b740f264d71140f Mon Sep 17 00:00:00 2001 From: Ritesh Shrivastav Date: Thu, 9 Apr 2020 16:07:16 +0530 Subject: [PATCH] Add Dockerfile --- Dockerfile | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..425d0e5 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM golang:1.12-alpine AS builder +RUN apk update && apk add make git +WORKDIR /sql-jobber/ +COPY ./ ./ +ENV CGO_ENABLED=0 GOOS=linux +RUN make build + +FROM alpine:latest AS deploy +RUN apk --no-cache add ca-certificates +COPY --from=builder /sql-jobber/sql-jobber ./ +COPY --from=builder /sql-jobber/sql ./ +RUN mkdir -p /opt/config +COPY --from=builder /sql-jobber/config.toml.sample /opt/config/sql-jobber.toml + +VOLUME ["/opt/config/"] + +CMD ["./sql-jobber", "--config", "/opt/config/sql-jobber.toml"]