forked from hairyhenderson/caddyprom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
41 lines (29 loc) · 1.07 KB
/
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
FROM golang:1.14.3-alpine3.11 AS BUILD
RUN apk add -U --no-cache ca-certificates git gcc musl-dev
RUN go get -u github.com/caddyserver/xcaddy/cmd/xcaddy
WORKDIR /app/caddyprom
#cache dependencies
ADD /go.mod /app/caddyprom/
ADD /go.sum /app/caddyprom/
RUN go get github.com/lucaslorentz/caddy-docker-proxy/plugin/v2
RUN go mod download
RUN go get -v github.com/caddyserver/caddy/v2
RUN go get -v github.com/lucaslorentz/caddy-docker-proxy/plugin/v2
ADD /caddyprom.go /app/caddyprom/
ADD /caddyprom_test.go /app/caddyprom/
ADD /promhttp_fork_delegator.go /app/caddyprom/
ADD /promhttp_fork_instrument_server.go /app/caddyprom/
ADD /setup.go /app/caddyprom/
RUN xcaddy build \
--output /app/caddy \
--with github.com/lucaslorentz/caddy-docker-proxy/plugin/v2 \
--with github.com/stutzlab/caddyprom=/app/caddyprom
FROM alpine:3.12.0
EXPOSE 80 443 2019
ENV XDG_CONFIG_HOME /config
ENV XDG_DATA_HOME /data
WORKDIR /
COPY --from=BUILD /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=BUILD /app/caddy /bin/caddy
ENTRYPOINT ["/bin/caddy"]
CMD ["docker-proxy"]