From ed9342bd734b67a895804db9ab1c500b00265d37 Mon Sep 17 00:00:00 2001 From: "Glenn Y. Rolland" Date: Wed, 22 Aug 2018 19:19:21 +0200 Subject: [PATCH] Add docker tooling --- Dockerfile | 19 ++++++++++++++----- docker-compose.yml | 0 2 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile index f0ddfbb..dd3e133 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,18 @@ FROM golang:1.10 AS build -COPY . /go/src/github.com/glenux/trello2mail-go + +RUN go get github.com/glenux/trello2mail-go/... WORKDIR /go/src/github.com/glenux/trello2mail-go -RUN CGO_ENABLED=0 go build -o trello2mail main.go +RUN CGO_ENABLED=0 go build ./... FROM alpine:3.7 -RUN apk add --no-cache ca-certificates -COPY --from=build /go/src/github.com/glenux/trello2mail-go/ /usr/bin/trello2mail -CMD ["./main"] +RUN apk update \ + && apk add --no-cache dcron ca-certificates \ + && rm -rf /var/cache/apk/* + +RUN mkdir /app +COPY --from=build /go/src/github.com/glenux/trello2mail-go/trello2mail /app/ +COPY trello2mail.cron /app/ +RUN /usr/bin/crontab /app/trello2mail.cron + +CMD ["/usr/sbin/cron","-f"] + diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..e69de29