mautrix-whatsapp/Dockerfile

29 lines
918 B
Text
Raw Normal View History

2018-08-24 22:06:55 +02:00
FROM golang:1-alpine AS builder
2018-08-24 22:51:38 +02:00
RUN apk add --no-cache git ca-certificates build-base
2018-08-26 16:29:51 +02:00
RUN wget -qO /usr/local/bin/dep https://github.com/golang/dep/releases/download/v0.5.0/dep-linux-amd64
RUN chmod +x /usr/local/bin/dep
COPY Gopkg.lock Gopkg.toml /go/src/maunium.net/go/mautrix-whatsapp/
2018-08-24 22:06:55 +02:00
WORKDIR /go/src/maunium.net/go/mautrix-whatsapp
2018-08-26 16:29:51 +02:00
RUN dep ensure -vendor-only
COPY . /go/src/maunium.net/go/mautrix-whatsapp
RUN go build -o /usr/bin/mautrix-whatsapp
2018-08-24 22:06:55 +02:00
FROM alpine:latest
ENV UID=1337 \
GID=1337
RUN apk add --no-cache \
su-exec
2018-08-24 22:06:55 +02:00
COPY --from=builder /usr/bin/mautrix-whatsapp /usr/bin/mautrix-whatsapp
COPY --from=builder /etc/ssl/certs/ /etc/ssl/certs
COPY --from=builder /go/src/maunium.net/go/mautrix-whatsapp/example-config.yaml /opt/mautrix-whatsapp/example-config.yaml
COPY --from=builder /go/src/maunium.net/go/mautrix-whatsapp/docker-run.sh /docker-run.sh
VOLUME /data
CMD ["/docker-run.sh"]