Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Dockerfile #6

Merged
merged 1 commit into from
Apr 9, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"]