forked from mjl-/mox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.release
33 lines (30 loc) · 1.06 KB
/
Dockerfile.release
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
FROM --platform=linux/amd64 docker.io/golang:1-alpine AS build
# note: cannot use $TARGETOS or $TARGETARCH because apparently the --platform in
# the FROM above overrides the actual target os/arch from the command-line.
ARG goos
ARG goarch
WORKDIR /
ARG moxversion
RUN CGO_ENABLED=0 GOOS=$goos GOARCH=$goarch go install -mod mod -trimpath github.com/mjl-/mox@$moxversion
RUN test -f /go/bin/mox && cp /go/bin/mox /bin/mox || cp /go/bin/${goos}_${goarch}/mox /bin/mox
# Using latest may break at some point, but will hopefully be convenient most of the time.
FROM --platform=$TARGETPLATFORM docker.io/alpine:latest
WORKDIR /mox
COPY --from=build /bin/mox /bin/mox
# SMTP for incoming message delivery.
EXPOSE 25/tcp
# SMTP/submission with TLS.
EXPOSE 465/tcp
# SMTP/submission without initial TLS.
EXPOSE 587/tcp
# HTTP for internal account and admin pages.
EXPOSE 80/tcp
# HTTPS for ACME (Let's Encrypt), MTA-STS and autoconfig.
EXPOSE 443/tcp
# IMAP with TLS.
EXPOSE 993/tcp
# IMAP without initial TLS.
EXPOSE 143/tcp
# Prometheus metrics.
EXPOSE 8010/tcp
CMD ["/bin/mox", "serve"]