forked from parca-dev/parca
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile.dev
50 lines (33 loc) · 1.29 KB
/
Dockerfile.dev
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
FROM node:16.6.1-alpine3.14 AS ui-deps
WORKDIR /app
COPY ui/packages/shared ./packages/shared
COPY ui/packages/app/web/package.json ./packages/app/web/package.json
COPY ui/package.json ui/yarn.lock ./
RUN yarn workspace @parca/web install --frozen-lockfile
FROM node:16.6.1-alpine3.14 AS ui-builder
WORKDIR /app
COPY ui .
COPY --from=ui-deps /app/node_modules ./node_modules
RUN yarn workspace @parca/web build
FROM golang:1.16-alpine AS builder
WORKDIR /app
RUN go install github.com/go-delve/delve/cmd/dlv@v1.6.0
RUN go install github.com/grpc-ecosystem/grpc-health-probe@latest
COPY go.mod go.sum /app/
RUN go mod download -modcacherw
COPY ./ui/ui.go ./ui/ui.go
COPY --from=ui-builder /app/packages/app/web/dist ./ui/packages/app/web/dist
COPY ./cmd /app/cmd
COPY ./pkg /app/pkg
COPY ./proto /app/proto
COPY ./gen /app/gen
COPY ./internal /app/internal
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -gcflags="all=-N -l" -o parca ./cmd/parca
FROM golang:1.16-alpine
RUN apk add --no-cache llvm
COPY --from=builder /go/bin/dlv /
COPY --from=builder /go/bin/grpc-health-probe /
COPY --from=builder /app/parca /parca
COPY parca.yaml /parca.yaml
EXPOSE 7070
ENTRYPOINT ["/dlv", "--listen=:40000", "--headless=true", "--api-version=2", "--accept-multiclient", "exec", "--continue", "--"]