A Docker Container to send selected logtails to a Discord Webhook
version: '3'
services:
log-to-discord:
#image: ghcr.io/lostontheline/log-to-discord:latest
image: lostontheline/log-to-discord:latest
container_name: log-to-discord
user: 1000:1000
environment:
PUID: 1000 #optional
PGID: 1000 #optional
LOG_FILE: /var/log/sample.log #Comma separated list if multiple files "/var/log/sample.log,/var/log/sample log file.txt,/var/log/my container/logfile.log"
DISCORD_WEBHOOK: "https://discord.com/api/webhooks/your-webhook-url"
#FILTER_BY_WORD: "error"
volumes:
- /docker/log/var/log:/var/log:rw
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
restart: always
#security_opt:
# - no-new-privileges:true
labels:
- "com.centurylinklabs.watchtower.scope=dockerhub"
# - "com.centurylinklabs.watchtower.scope=github"
This container is designed to run as a non-root user
I have a label for Watchtower, that can obviously be removed or edited to your own needs.
==> /var/log/sample.log <==
2023-03-20 @ 00:37:00
==> /var/log/cron.log <==
crond: wakeup dt=60
I have included the image:
calls for both Docker Hub & (commented out) for this GitHub Package.
As it looks nicer, sorts nicer, & is easier to upload & manage, the Docker Hub one is my preferred method & will always get updated 1st, but I'll try to make sure this one happens right after & any changes are updated here.