forked from keploy/keploy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
50 lines (31 loc) · 1.1 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
41
42
43
44
45
46
47
48
49
50
# build ui
FROM --platform=${BUILDPLATFORM} node:18-bullseye as ui-builder
#RUN apt-get update && apt-get install libvips-dev -y
RUN npm install -g gatsby-cli
RUN git clone https://github.com/keploy/ui
WORKDIR /ui
RUN npm install --legacy-peer-deps
ARG KEPLOY_PATH_PREFIX='/'
RUN PATH_PREFIX="$KEPLOY_PATH_PREFIX" gatsby build --prefix-paths
# build stage
FROM --platform=${BUILDPLATFORM} golang:alpine as go-builder
RUN apk add -U --no-cache ca-certificates && apk add build-base
ENV GO111MODULE=on
# Build Delve
RUN go install github.com/go-delve/delve/cmd/dlv@latest
WORKDIR /app
COPY go.mod .
COPY go.sum .
RUN go mod download
COPY . .
COPY --from=ui-builder /ui/public /app/web/public
#RUN CGO_ENABLED=0 GOOS=linux go build -o health cmd/health/main.go
RUN CGO_ENABLED=0 GOOS=linux go build -o keploy cmd/server/main.go
# final stage
FROM --platform=${BUILDPLATFORM} alpine
COPY --from=alpine /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
#COPY --from=builder /app/health /app/
COPY --from=go-builder /app/keploy /app/
COPY --from=go-builder /go/bin/dlv /
EXPOSE 6789
ENTRYPOINT ["/app/keploy"]