edirpedro / vnstat-dashboard

Data Visualization app for vnStat
MIT License
8 stars 1 forks source link

Is it possible to have a docker version? #1

Closed tonyzhou777 closed 3 months ago

tonyzhou777 commented 6 months ago

Hello. A docker version would be very convenient for different environments. Is it possible to have one?

Thanks.

edirpedro commented 6 months ago

I don't use Docker, but you can up any web server image and host it. I tried Nginx here, follow the steps:

  1. Download the repository and move the folder /build to where you want to save the app, rename it if you want.
  2. In this folder create a file docker-compose.yml and write on it:
version: "3.9"
name: vnstat_dashboard

services:
  web:
    image: nginx
    restart: unless-stopped
    ports:
      - 8000:80
    volumes:
      - ./:/usr/share/nginx/html
  1. Open the Terminal and on this folder type docker-compose up -d
  2. Follow the steps to make the Crontab send the reports to /location/to/build/api every 5 minutes.
  3. Open http://localhost:8000. Make sure the report file are available on the api folder.

Tell me if this works, maybe a I can put this option available. I wanted to use a custom domain like "vnstat.local" but I couldn't find an easy step to setup this on Docker.