Skip to content

Instantly share code, notes, and snippets.

@r6m
Last active January 22, 2018 06:41
Show Gist options
  • Save r6m/1087e74d3414b9e766cbeb14ee6344bb to your computer and use it in GitHub Desktop.
Save r6m/1087e74d3414b9e766cbeb14ee6344bb to your computer and use it in GitHub Desktop.
goaccess Dockerfile
# build docker image
docker build -t goaccess .
# run docker image
# two volumes are required:
# [ -v /var/log/nginx/:/var/log/nginx ] for nginx log files
# [ -v /home/deploy/logs/www:/home/root/www ] to serve static file (report.html will be in www)
# ws port is 7890 (don't forget to open the port)
# NOTE: real-time-html mode is ON
docker run -d --restart always -p 7890:7890 -t -v /var/log/nginx/:/var/log/nginx -v /home/deploy/logs/www:/home/root/www --name logs goaccess
FROM debian:jessie
MAINTAINER Reza Morsali
# install dependencies
RUN apt-get update && apt-get install -y wget git autoconf build-essential gettext libgettextpo-dev libgeoip-dev libncursesw5-dev pkg-config libglib2.0 && git clone https://github.com/allinurl/goaccess.git && cd goaccess && autoreconf -fiv && ./configure --enable-geoip --enable-utf8 && make && make install && apt-get purge -y wget git autoconf build-essential libncursesw5-dev pkg-config && apt-get autoremove -y && apt-get clean && rm -rf /var/lib/apt/lists/* && cd .. && rm -rf goaccess
RUN mkdir -p /home/root/www
RUN touch /home/root/www/report.html
EXPOSE 7890
# log-format COMBINED
# real-time-html true
# you can also change html output
CMD goaccess /var/log/nginx/access.log --log-format=COMBINED -o /home/root/www/report.html --real-time-html --port=7890
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment