Skip to content

melbv/docker-logs-web-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

docker-logs-web-server

Web server for docker logs

I was looking for a quick way to access my docker logs without the fuss of setting up a compicated monitoring tool like Grafana, Prometheus or other. This is a 3hours project to offer a webserver for docker logs for any home-labber. The web server is served on port 8080 and is written to be exposed to all interfaces (i.e. Tailscale, VPN tunnel of any sort, LAN and/or web if your host is exposed to the web too). You can restrict the interfaces in the netcat command in the script.

⚠️ This is a WIP and will add features as we go like auto-refresh or filtering/search abilities

⚠️ Make sure you have all dependencies installed. If not, run sudo apt install gq netcat-traditional


Best is to set up the script as a service on Linux rather than run it directly from terminal. Below is a short recipe to run this as a service:

  1. Copy the repo into a folder

git clone https://github.com/melbv/docker-logs-web-server

  1. Save the file in your systemd path:

sudo cp /folder/where/repo/cloned/docker-logs-web.sh /usr/local/bin/docker-logs-web.sh

  1. Make the file executable

sudo chmod +x /usr/local/bin/docker-logs-web.sh

  1. Create the service file

sudo nano /etc/systemd/system/docker-logs-web.service

  1. Add the following
[Unit]
Description=Docker Logs Web Server
After=docker.service
Requires=docker.service

[Service]
Type=simple
User=root
ExecStart=/usr/local/bin/docker-logs-web.sh
Restart=always
RestartSec=5
StandardOutput=journal
StandardError=journal

[Install]
WantedBy=multi-user.target
  1. Reload systemd, enable the service and start it
sudo systemctl daemon-reload
sudo systemctl enable docker-logs-web.service
sudo systemctl start docker-logs.web.service

🎉 Well done! You now have a rudimentary webserver that allows you to access your docker logs without the fuss of modern monitoring tools.

About

Web server for docker logs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages