No description
Find a file
paspo 112dd93c92
All checks were successful
Container Publish / on-success-skip (push) Has been skipped
Container Publish / build-image (amd64) (push) Successful in 21s
Container Publish / build-image (arm64) (push) Successful in 20s
Container Publish / update docker manifest (push) Successful in 8s
docs
2026-01-05 12:42:24 +01:00
.forgejo/workflows initial release 2026-01-05 12:16:59 +01:00
rootfs/app initial release 2026-01-05 12:16:59 +01:00
Dockerfile initial release 2026-01-05 12:16:59 +01:00
LICENSE initial release 2026-01-05 12:16:59 +01:00
README.md docs 2026-01-05 12:42:24 +01:00

logrotate sidecar container

usage

Sample docker-compose.yaml file:

services:
  traefik:
    image: traefik:v3
    container_name: traefik
    restart: always
    command:
      - "--configFile=/config/traefik.yaml"
    environment:
      - TZ=Europe/Rome
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./config:/config
      - ./logs:/logs
      - ./acme:/acme
      - /var/run/docker.sock:/var/run/docker.sock
    networks:
      - backend

  traefik-logrotate:
    image: docker.asperti.com/paspo/logrotate:latest
    container_name: traefik-logrotate
    pid: "service:traefik"  # this is needed to signal traefik reload
    volumes:
      - ./logs:/logs
      - ./logrotate.conf:/etc/logrotate.d/traefik.conf:ro

Sample logrotate.conf file:

/logs/access.log {
    daily
    rotate 14
    missingok
    notifempty
    compress
    delaycompress
    copytruncate
    size 200M

    postrotate
        kill -USR1 1
    endscript
}

manual run

docker compose exec traefik-logrotate /etc/periodic/daily/logrotate