Skip to content

Commit

Permalink
Merge pull request #2 from mr-karan/docker
Browse files Browse the repository at this point in the history
feat: Add dockerfile
  • Loading branch information
mr-karan committed Apr 19, 2019
2 parents eb912f9 + 1937d07 commit e6c82d9
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 1 deletion.
15 changes: 15 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: "3.7"

services:
app:
restart: unless-stopped
build:
context: .
dockerfile: docker/Dockerfile
args:
- GO_VERSION=1.12
image: calert:1.0.0-stable
ports:
- "6000:6000"
volumes:
- '/Users/docker-data/:/etc/calert'
17 changes: 17 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
ARG GO_VERSION=1.12
FROM golang:${GO_VERSION}-alpine AS builder
RUN apk update && apk add gcc libc-dev make git
WORKDIR /calert/
COPY ./ ./
ENV CGO_ENABLED=0 GOFLAGS=-mod=vendor GOOS=linux
RUN make build

FROM alpine:latest AS deploy
RUN apk --no-cache add ca-certificates
WORKDIR /calert/
COPY --from=builder /calert/ ./
RUN mkdir -p /etc/calert && cp config.toml.sample /etc/calert/config.toml
# Define data volumes
VOLUME ["/etc/calert"]
CMD ["./calert.bin", "--config.file", "/etc/calert/config.toml"]

2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ module github.com/mr-karan/calert

require (
github.com/google/pprof v0.0.0-20190109223431-e84dfd68c163 // indirect
github.com/gorilla/context v1.1.1 // indirect
github.com/gorilla/mux v1.6.2
github.com/prometheus/alertmanager v0.15.3
github.com/prometheus/common v0.0.0-20181218105931-67670fe90761 // indirect
github.com/spf13/pflag v1.0.3
github.com/spf13/viper v1.3.1
github.com/stretchr/testify v1.2.2
golang.org/x/arch v0.0.0-20181203225421-5a4828bb7045 // indirect
)
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/google/pprof v0.0.0-20190109223431-e84dfd68c163 h1:beB+Da4k9B1zmgag78k3k1Bx4L/fdWr5FwNa0f8RxmY=
github.com/google/pprof v0.0.0-20190109223431-e84dfd68c163/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/gorilla/context v1.1.1 h1:AWwleXJkX/nhcU9bZSnZoi3h/qGYqQAGhq6zZe/aQW8=
github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
github.com/gorilla/mux v1.6.2 h1:Pgr17XVTNXAk3q/r4CpKzC5xBM/qW1uVLV+IhRZpIIk=
github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
Expand Down

0 comments on commit e6c82d9

Please sign in to comment.