Skip to content

Commit

Permalink
Merge pull request #6 from johnnybravo-xyz/docker
Browse files Browse the repository at this point in the history
Add Dockerfile
  • Loading branch information
knadh authored Apr 9, 2020
2 parents 7bdeaed + ad99028 commit 4b11431
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]

0 comments on commit 4b11431

Please sign in to comment.