-
Notifications
You must be signed in to change notification settings - Fork 215
/
Dockerfile.dev
57 lines (39 loc) · 1.95 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
51
52
53
54
55
56
57
# vim: ft=dockerfile
FROM docker.io/node:16.20.2-alpine@sha256:a1f9d027912b58a7c75be7716c97cfbc6d3099f3a97ed84aa490be9dee20e787 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/pnpm-lock.yaml ./
RUN pnpm --filter @parca/web install --frozen-lockfile --prefer-offline
FROM docker.io/node:16.20.2-alpine@sha256:a1f9d027912b58a7c75be7716c97cfbc6d3099f3a97ed84aa490be9dee20e787 AS ui-builder
WORKDIR /app
COPY ui .
COPY --from=ui-deps /app/node_modules ./node_modules
RUN pnpm install --frozen-lockfile --prefer-offline && pnpm run build
FROM docker.io/golang:1.23.3-alpine@sha256:09742590377387b931261cbeb72ce56da1b0d750a27379f7385245b2b058b63a AS builder
# renovate: datasource=go depName=github.com/go-delve/delve
ARG DLV_VERSION=v1.23.1
# renovate: datasource=go depName=github.com/grpc-ecosystem/grpc-health-probe
ARG GRPC_HEALTH_PROBE_VERSION=v0.4.35
WORKDIR /app
# hadolint ignore=DL3018
RUN apk update && apk add --no-cache build-base
RUN go install "github.com/go-delve/delve/cmd/dlv@${DLV_VERSION}"
# hadolint ignore=DL3059
RUN go install "github.com/grpc-ecosystem/grpc-health-probe@${GRPC_HEALTH_PROBE_VERSION}"
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/build ./ui/packages/app/web/build
COPY ./cmd /app/cmd
COPY ./pkg /app/pkg
COPY ./proto /app/proto
COPY ./gen /app/gen
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -gcflags="all=-N -l" -o parca ./cmd/parca
FROM docker.io/golang:1.23.3-alpine@sha256:09742590377387b931261cbeb72ce56da1b0d750a27379f7385245b2b058b63a
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", "--"]