Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updating docker container default paths for logs,report,data #1545

Merged
merged 1 commit into from
Sep 10, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 25 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,13 @@ If you only want to output the report, run as follows to get the result:
---

**Note**: The following example assumes you will store your GoAccess data below
``/srv/goaccess``, but you can use a different prefix if you like or if you run
`/srv/goaccess`, but you can use a different prefix if you like or if you run
as non-root user.

mkdir -p /srv/goaccess/{data,html}
mkdir -p /srv/goaccess/{data,html,logs}

Before running your own GoAccess Docker container, first create a config file
in ``/srv/goaccess/data``. You can start one from scratch or use the one from
in `/srv/goaccess/data`. You can start one from scratch or use the one from
[`config/goaccess.conf`](https://raw.githubusercontent.com/allinurl/goaccess/master/config/goaccess.conf)
as a starting point and change it as needed.

Expand All @@ -229,10 +229,13 @@ following options: `log-format`, `log-file`, `output` and `real-time-html`. For
example, for Apache's *combined* log format:

log-format COMBINED
log-file /srv/logs/access.log
output /srv/report/index.html
log-file /goaccess/access.log
output /goaccess/index.html
real-time-html true

**(Note)**: The docker container doesn't use subfolders `/srv/{data,html,logs}` anymore.
Goaccess container will now by default look for files inside its `/goaccess` folder.

If you want to expose goaccess on a different port on the host machine, you
*have to* set the `ws-url` option in the config file, e.g.:

Expand All @@ -253,11 +256,12 @@ and then build and run the image as follows:

docker build . -t allinurl/goaccess
docker run --restart=always -d -p 7890:7890 \
-v "/srv/goaccess/data:/srv/data" \
-v "/srv/goaccess/html:/srv/report" \
-v "/var/log/apache2:/srv/logs" \
--name=goaccess allinurl/goaccess

-v "/srv/goaccess/data:/goaccess" \
-v "/srv/goaccess/html/index.html:/goaccess/index.html" \
-v "/var/log/apache2/access.log:/goaccess/access.log" \
--name=goaccess allinurl/goaccess \
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part of the readme used to instruct to run the docker container without specifying any command. For me, this is no longer working, I have to specify a command.

So this part is now a bit redondant with the below part talking about command that can be passed to customize behavior.

goaccess --no-global-config --config-file=/goaccess/goaccess.conf

If you you made changes to the config file after building the image, you don't
have to rebuild from scratch. Simply restart the container:

Expand All @@ -280,13 +284,13 @@ Note, it is possible to specify a different command and command line options to
run in the container directly on the docker command line, e.g.:

docker run --restart=always -d -p 8080:7890 \
-v "/srv/goaccess/data:/srv/data" \
-v "/srv/goaccess/html:/srv/report" \
-v "/var/log/apache:/srv/logs" \
--name=goaccess allinurl/goaccess \
goaccess --no-global-config --config-file=/srv/data/goaccess.conf \
--ws-url=example.org:8080 --output=/srv/report/index.html \
--log-file=/srv/logs/access.log
-v "/srv/goaccess/data:/goaccess" \
-v "/srv/goaccess/html/index.html:/goaccess/index.html" \
-v "/var/log/apache/access.log:/goaccess/access.log" \
--name=goaccess allinurl/goaccess \
goaccess --no-global-config --config-file=/goaccess/goaccess.conf \
--ws-url=example.org:8080 --output=/goaccess/index.html \
--log-file=/goaccess/access.log

The container and image can be completely removed as follows:

Expand All @@ -299,10 +303,10 @@ image**](https://hub.docker.com/r/allinurl/goaccess/) that can be run without
cloning the git repository:

docker run --restart=always -d -p 8080:7890 \
-v "/srv/goaccess/data:/srv/data" \
-v "/srv/goaccess/logs:/srv/logs" \
-v "/srv/goaccess/html:/srv/report" \
--name=goaccess allinurl/goaccess
-v "/srv/goaccess/data:/goaccess" \
-v "/srv/goaccess/html/index.html:/goaccess/index.html" \
-v "/var/log/apache/access.log:/goaccess/access.log" \
--name=goaccess allinurl/goaccess

## Storage ##

Expand Down