-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
48 lines (32 loc) · 904 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
FROM golang:1.18 as builder
WORKDIR /app
COPY go.mod .
COPY go.sum .
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -o mailroom ./cmd/mailroom/main.go
RUN apt update && apt install -y curl
RUN export GOFLOW_VERSION=$(grep goflow go.mod | cut -d" " -f2 | head -n 1) && \
curl -L https://github.com/nyaruka/goflow/releases/download/${GOFLOW_VERSION}/docs.tar.gz | tar zxv && \
cp ./docs/en-us/*.* docs/
FROM alpine:3.7
ENV USER=mailroom
ENV UID=13337
ENV GID=13337
RUN addgroup -g "$GID" "$USER" \
&& adduser \
-D \
-g "" \
-h "$(pwd)" \
-G "$USER" \
-H \
-u "$UID" \
"$USER"
RUN apk update && apk add ca-certificates tzdata && rm -rf /var/cache/apk/*
WORKDIR /app
COPY --from=builder /app/mailroom .
COPY --from=builder /app/docs ./docs
EXPOSE 8080
USER mailroom
ENTRYPOINT []
CMD ["/app/mailroom"]