-
-
Notifications
You must be signed in to change notification settings - Fork 69
/
Copy pathDockerfile
41 lines (24 loc) · 829 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
FROM openfaas/classic-watchdog:0.15.4 as watchdog
FROM golang:1.10.4-alpine as build
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 -a -installsuffix cgo -o derek .
FROM alpine:3.10 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"]