This repository has been archived by the owner on Jun 15, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
66 lines (62 loc) · 2.19 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
FROM ghcr.io/linuxserver/baseimage-alpine:3.15
# set version label
ARG BUILD_DATE
ARG VERSION
ARG SCRUTINY_RELEASE
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="alex-phillips"
RUN \
echo "**** install build packages ****" && \
apk add -U --update --no-cache --virtual=build-dependencies \
curl \
gcc \
go \
musl-dev \
nodejs \
npm && \
apk add -U --update --no-cache \
smartmontools && \
echo "**** install scrutiny ****" && \
if [ -z ${SCRUTINY_RELEASE+x} ]; then \
SCRUTINY_RELEASE=$(curl -sX GET https://api.github.com/repos/AnalogJ/scrutiny/commits/master \
| awk '/sha/{print $4;exit}' FS='[""]'); \
fi && \
curl -o \
/tmp/scrutiny.tar.gz -L \
"https://github.com/AnalogJ/scrutiny/archive/${SCRUTINY_RELEASE}.tar.gz" && \
mkdir -p \
/app/scrutiny && \
tar xf \
/tmp/scrutiny.tar.gz -C \
/app/scrutiny --strip-components=1 && \
echo "**** building scrutiny ****" && \
cd /app/scrutiny && \
go mod vendor && \
go build -ldflags '-w -extldflags "-static"' -o scrutiny webapp/backend/cmd/scrutiny/scrutiny.go && \
go build -ldflags '-w -extldflags "-static"' -o scrutiny-collector-selftest collector/cmd/collector-selftest/collector-selftest.go && \
go build -ldflags '-w -extldflags "-static"' -o scrutiny-collector-metrics collector/cmd/collector-metrics/collector-metrics.go && \
mv /app/scrutiny/scrutiny /usr/local/bin/ && \
mv /app/scrutiny/scrutiny-collector-selftest /usr/local/bin/ && \
mv /app/scrutiny/scrutiny-collector-metrics /usr/local/bin/ && \
chmod +x /usr/local/bin/scrutiny* && \
echo "**** build scrutiny frontend ****" && \
cd /app/scrutiny/webapp/frontend && \
mkdir -p /app/scrutiny-web && \
npm install && \
npx ng build --output-path=/app/scrutiny-web --deploy-url="/web/" --base-href="/web/" --prod && \
echo "**** cleanup ****" && \
cd /app && \
rm -rf /app/scrutiny && \
apk del --purge \
build-dependencies && \
rm -rf \
/root/.cache \
/tmp/* \
/root/go \
/root/.npm && \
echo "**** network fixes ****" && \
printf "hosts: files dns" > /etc/nsswitch.conf
# copy local files
COPY root/ /
EXPOSE 8080
VOLUME /config