forked from KostyaEsmukov/smtp_to_telegram
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
32 lines (18 loc) · 604 Bytes
/
Dockerfile
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
FROM golang:1.17-alpine3.14 AS builder
RUN apk add --no-cache git ca-certificates mailcap
WORKDIR /app
COPY . .
# The image should be built with
# --build-arg ST_VERSION=`git describe --tags --always`
ARG ST_VERSION
RUN CGO_ENABLED=0 GOOS=linux go build \
-ldflags "-s -w \
-X main.Version=${ST_VERSION:-UNKNOWN_RELEASE}" \
-a -o smtp_to_telegram
FROM alpine:3.14
RUN apk add --no-cache ca-certificates mailcap
COPY --from=builder /app/smtp_to_telegram /smtp_to_telegram
USER daemon
ENV ST_SMTP_LISTEN="0.0.0.0:2525"
EXPOSE 2525
ENTRYPOINT ["/smtp_to_telegram"]