Add docker tooling

This commit is contained in:
Glenn Y. Rolland 2018-08-22 19:19:21 +02:00
parent e88250a913
commit ed9342bd73
2 changed files with 14 additions and 5 deletions

View file

@ -1,9 +1,18 @@
FROM golang:1.10 AS build 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 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 FROM alpine:3.7
RUN apk add --no-cache ca-certificates RUN apk update \
COPY --from=build /go/src/github.com/glenux/trello2mail-go/ /usr/bin/trello2mail && apk add --no-cache dcron ca-certificates \
CMD ["./main"] && 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"]

0
docker-compose.yml Normal file
View file