blob: f3039287f1fa03afe3095a18fd3db3cca8d072d1 [file] [log] [blame]
avm9996388e622d2021-01-22 18:57:58 +01001FROM golang:latest as builder
2
3ENV CGO_ENABLED=0
4
5ENV GO111MODULE=on
6ENV GOPROXY=https://proxy.golang.org
7
8RUN mkdir /gocache
9ENV GOCACHE /gocache
10
11COPY go.mod /go/src/gomodules.avm99963.com/hichip2mqtt/go.mod
12COPY go.sum /go/src/gomodules.avm99963.com/hichip2mqtt/go.sum
13
14WORKDIR /go/src/gomodules.avm99963.com/hichip2mqtt
15
16# Optimization for iterative docker build speed, not necessary for correctness:
17RUN go install github.com/eclipse/paho.mqtt.golang
18RUN go install github.com/flashmob/go-guerrilla
19RUN go install github.com/go-sql-driver/mysql
20RUN go install github.com/sirupsen/logrus
21RUN go install github.com/spf13/cobra
22RUN go install gomodules.avm99963.com/forks/parsemail
23
24WORKDIR /go/src/gomodules.avm99963.com/hichip2mqtt/cmd/hichipbridge
25
26COPY . /go/src/gomodules.avm99963.com/hichip2mqtt/cmd/hichipbridge
27
28RUN go install gomodules.avm99963.com/hichip2mqtt/cmd/hichipbridge
29
30FROM alpine
31LABEL maintainer "me@avm99963.com"
32
33RUN apk add --no-cache tini
34COPY --from=builder /go/bin/hichipbridge /
35ENTRYPOINT ["/sbin/tini", "--", "/hichipbridge", "serve"]