forked from alexellis/derek
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
44 lines (26 loc) · 878 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
FROM openfaas/classic-watchdog:0.18.10 as watchdog
FROM golang:1.13-alpine as build
ENV CGO_ENABLED=0
ENV GO111MODULE=on
WORKDIR /go/src/github.com/alexellis/derek
COPY . .
RUN go test $(go list ./... | grep -v /vendor/) -cover
RUN CGO_ENABLED=0 GOOS=linux go build -mod=vendor -a -installsuffix cgo -o derek .
FROM alpine:3.12 as ship
COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog
RUN chmod +x /usr/bin/fwatchdog
RUN apk --no-cache add ca-certificates
RUN addgroup -S app && adduser -S -g app app
RUN mkdir -p /home/app
WORKDIR /home/app
COPY --from=build /go/src/github.com/alexellis/derek/derek derek
RUN chown -R app /home/app
USER app
ENV cgi_headers="true"
ENV validate_hmac="true"
ENV validate_customers="true"
ENV combine_output="true"
ENV fprocess="./derek"
HEALTHCHECK --interval=5s CMD [ -e /tmp/.lock ] || exit 1
EXPOSE 8080
CMD ["fwatchdog"]