forked from coupergateway/couper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
28 lines (23 loc) · 844 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
FROM golang:1.16 AS builder
WORKDIR /go/src/app
COPY . .
ENV GOFLAGS="-mod=vendor" \
VERSION_PACKAGE="github.com/avenga/couper/utils"
RUN go generate && \
CGO_ENABLED=0 go build -v \
-ldflags "-X ${VERSION_PACKAGE}.VersionName=`git describe --tags --abbrev=0 --exact-match || git symbolic-ref -q --short HEAD` -X ${VERSION_PACKAGE}.BuildName=`git rev-parse --short HEAD` -X ${VERSION_PACKAGE}.BuildDate=`date +'%F'`" \
-o /couper main.go && \
ls -lh /couper
FROM scratch
# copy debian tls ca certs (from golang image)
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=builder /couper /couper
COPY public/couper.hcl /conf/
COPY public/index.html /htdocs/
WORKDIR /conf
ENV COUPER_LOG_FORMAT=json \
DOC_DIR=/htdocs
EXPOSE 8080
USER 1000:1000
ENTRYPOINT ["/couper"]
CMD ["run"]