-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
45 lines (36 loc) · 1.36 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
ARG ALPINE_VERSION=3.10.2
# Builds a goaccess image from the current working directory:
FROM alpine:${ALPINE_VERSION}
ARG build_deps="build-base ncurses-dev autoconf automake git gettext-dev"
ARG runtime_deps="tini ncurses libintl gettext musl-utils libmaxminddb libmaxminddb-dev "
ARG geolib_path="/usr/local/share/GeoIP"
ARG geolib_filename="GeoCity.dat"
# Uncomment in case of premium library usage
#COPY ./GeoIP2-City.mmdb $geolib_path/$geolib_filename
# Using GeoIP Lite version
RUN if [ ! -f $geolib_path/$geolib_filename ]; then \
mkdir -p $geolib_path/ && \
wget -q -O - http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz | \
tar \
--strip-components=1 \
-C $geolib_path/ \
-xzvf - && \
mv $geolib_path/GeoLite2-City.mmdb $geolib_path/$geolib_filename; \
fi
RUN apk update && \
apk add -u $runtime_deps $build_deps && \
git clone https://github.com/allinurl/goaccess /goaccess && \
cd /goaccess && \
autoreconf -fiv && \
./configure --enable-utf8 --enable-geoip=mmdb && \
make && \
make install && \
apk del $build_deps && \
rm -rf /var/cache/apk/* /tmp/goaccess/* /goaccess
RUN ldconfig /
VOLUME /srv/data
VOLUME /srv/report
VOLUME /srv/log
EXPOSE 7890
ENTRYPOINT ["/sbin/tini", "--"]
CMD ["goaccess", "--no-global-config", "--config-file=/srv/data/goaccess.conf"]