59 lines
1.5 KiB
Markdown
59 lines
1.5 KiB
Markdown
# goaccess-docker
|
|
|
|
[GoAccess](https://github.com/allinurl/goaccess) Alpine docker image using Nginx for easy proxying.
|
|
|
|
## Usage
|
|
|
|
### Docker
|
|
|
|
```bash
|
|
docker run --name goaccess -p 7889:7889 -v /path/to/host/nginx/logs:/opt/log:ro -v /path/to/GeoLite2-City.mmdb:/GeoLite2-City.mmdb -v /path/to/goaccess/storage:/config -d registry.karaolidis.com/karaolidis/goaccess-docker
|
|
```
|
|
|
|
### Docker Compose
|
|
|
|
```yaml
|
|
version: '3'
|
|
services:
|
|
goaccess:
|
|
image: registry.karaolidis.com/karaolidis/goaccess-docker
|
|
container_name: goaccess
|
|
restart: unless-stopped
|
|
ports:
|
|
- "7889:7889"
|
|
volumes:
|
|
- "/path/to/host/nginx/logs:/opt/log:ro"
|
|
- "/path/to/GeoLite2-City.mmdb:/GeoLite2-City.mmdb"
|
|
- "/path/to/goaccess/storage:/config"
|
|
```
|
|
|
|
## Volume Mounts
|
|
|
|
* `/opt/log` - Nginx logs
|
|
* `/GeoLite2-City.mmdb` - GeoLite2 City database (get it from [here](https://dev.maxmind.com/geoip/geolite2-free-geolocation-data))
|
|
* `/config` - GoAccess configuration and static files
|
|
|
|
## Environment Variables
|
|
|
|
* `PUID` - User ID to run GoAccess and Nginx as
|
|
* `PGID` - Group ID to run GoAccess and Nginx as
|
|
* `TZ` - Timezone to use
|
|
|
|
## Example Nginx Configuration
|
|
|
|
```
|
|
location ^~ /goaccess {
|
|
resolver 127.0.0.11 valid=30s;
|
|
|
|
proxy_connect_timeout 1d;
|
|
proxy_send_timeout 1d;
|
|
proxy_read_timeout 1d;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "Upgrade";
|
|
|
|
set $upstream_goaccess goaccess;
|
|
proxy_pass http://$upstream_goaccess:7889/;
|
|
}
|
|
```
|