-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathDockerfile
33 lines (27 loc) · 1.04 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
FROM alpine:latest
LABEL author="Teemu Toivola"
LABEL repository.git="https://github.com/vergoh/vnstat-docker"
LABEL repository.docker="https://hub.docker.com/r/vergoh/vnstat"
ENV HTTP_PORT=8586
ENV HTTP_BIND=*
ENV HTTP_LOG=/dev/stdout
ENV LARGE_FONTS=0
ENV CACHE_TIME=1
ENV RATE_UNIT=1
ENV PAGE_REFRESH=0
RUN apk add --no-cache gcc musl-dev make perl gd gd-dev sqlite-libs sqlite-dev linux-headers lighttpd && \
wget https://humdi.net/vnstat/vnstat-latest.tar.gz && \
tar zxvf vnstat-latest.tar.gz && \
cd vnstat-*/ && \
./configure --prefix=/usr --sysconfdir=/etc && \
make && make install && \
cd .. && rm -fr vnstat* && \
apk del gcc pkgconf gd-dev make musl-dev sqlite-dev linux-headers && \
addgroup -S vnstat && adduser -S -h /var/lib/vnstat -s /sbin/nologin -g vnStat -D -H -G vnstat vnstat
COPY vnstat.cgi /var/www/localhost/htdocs/index.cgi
COPY vnstat-json.cgi /var/www/localhost/htdocs/json.cgi
COPY favicon.ico /var/www/localhost/htdocs/favicon.ico
VOLUME /var/lib/vnstat
EXPOSE ${HTTP_PORT}
COPY start.sh /
CMD [ "/start.sh" ]