forked from pingcap/tidb-dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
41 lines (31 loc) · 812 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
29
30
31
32
33
34
35
36
37
38
39
40
41
FROM golang:1.18-alpine3.16 as builder
RUN apk add --no-cache \
make \
git \
bash \
curl \
findutils \
gcc \
libc-dev \
nodejs \
npm \
openjdk11
RUN npm install -g pnpm
RUN mkdir -p /go/src/github.com/pingcap/tidb-dashboard/ui
WORKDIR /go/src/github.com/pingcap/tidb-dashboard
# Cache go module dependencies.
COPY go.mod .
COPY go.sum .
RUN GO111MODULE=on go mod download
# Cache npm dependencies.
WORKDIR /go/src/github.com/pingcap/tidb-dashboard/ui
COPY ui/pnpm-lock.yaml .
RUN pnpm fetch
# Build.
WORKDIR /go/src/github.com/pingcap/tidb-dashboard
COPY . .
RUN make package PNPM_INSTALL_TAGS=--offline
FROM alpine:3.16
COPY --from=builder /go/src/github.com/pingcap/tidb-dashboard/bin/tidb-dashboard /tidb-dashboard
EXPOSE 12333
ENTRYPOINT ["/tidb-dashboard"]