forked from skx/webmail
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (23 loc) · 691 Bytes
/
Copy pathDockerfile
File metadata and controls
35 lines (23 loc) · 691 Bytes
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
# Builder
FROM golang:alpine as builder
WORKDIR /go/src/manslaughter03/webmail
ENV GO111MODULE=on
ADD go.mod .
ADD go.sum .
RUN apk add --update git \
&& go mod download
COPY ./ ./
RUN CGO_ENABLED=0 GOOS=linux go build -v -a -installsuffix cgo -o app .
# Final image
FROM alpine:latest
RUN apk add --no-cache --update ca-certificates tzdata \
&& cp /usr/share/zoneinfo/Europe/Paris /etc/localtime \
&& echo "Europe/Paris" > /etc/timezone \
&& mkdir -p /usr/src/app/data \
&& adduser -D webmail \
&& chown -R webmail:webmail /usr/src/app \
&& apk del tzdata
USER webmail
WORKDIR /usr/src/app
COPY --from=builder /go/src/manslaughter03/webmail .
ENTRYPOINT ["./app"]