This repository was archived by the owner on Apr 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile
More file actions
47 lines (31 loc) · 1.22 KB
/
Dockerfile
File metadata and controls
47 lines (31 loc) · 1.22 KB
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
FROM node:14.6-buster AS node-builder
RUN apt-get update \
&& apt-get install -y wget gnupg ca-certificates \
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
&& apt-get update \
&& apt-get install -y google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY web/package.json .
COPY web/package-lock.json .
RUN npm ci
RUN npm i puppeteer
COPY web .
RUN npm run build
FROM golang:1.15-alpine AS golang-builder
RUN apk -U --no-cache add build-base git
WORKDIR /go/src/github.com/aeneasr/dockerstats
ADD go.mod go.mod
ADD go.sum go.sum
RUN go mod download
RUN GO111MODULE=on go install github.com/gobuffalo/packr/packr
ADD . .
COPY --from=node-builder /app/build web/build
RUN packr
RUN CGO_ENABLED=0 go build -a -o /usr/bin/dockerstats
FROM alpine:3.12
COPY --from=golang-builder /usr/bin/dockerstats /usr/bin/dockerstats
ENTRYPOINT ["dockerstats"]
CMD ["serve","--task-count=2","--snapshot-interval=2"]