Last active
May 7, 2024 04:07
-
-
Save arsalanses/f275fe5b2eccf27368b60b4b03569b5a to your computer and use it in GitHub Desktop.
goaccess + nginx container to serve report
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| services: | |
| nginx: | |
| image: nginx:alpine | |
| volumes: | |
| - /opt/goaccess/report.html:/usr/share/nginx/html/index.html:ro | |
| networks: | |
| - web | |
| labels: | |
| - "traefik.enable=true" | |
| - "traefik.docker.network=web" | |
| - "traefik.http.routers.report.entrypoints=https" | |
| - "traefik.http.routers.report.rule=Host(`report.example.com`)" | |
| - "traefik.http.services.report.loadbalancer.server.port=80" | |
| - "traefik.http.routers.report.tls=true" | |
| - "traefik.http.routers.report.tls.certresolver=lets-encrypt" | |
| - "traefik.http.routers.report.middlewares=auth" | |
| - "traefik.http.middlewares.auth.basicauth.users=admin:password" | |
| networks: | |
| web: | |
| external: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cat /var/log/traefik/access.log | docker run --rm -i -e LANG=$LANG allinurl/goaccess -a -o html --log-format COMBINED - > /opt/goaccess/report.html | |
| # wc -l /var/log/traefik/access.log | |
| echo "" > /var/log/traefik/access.log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment