For enhanced security, you may want to restrict log access to specific individuals. You can configure a private log viewer in your Docker Compose file using open-source tools like Dozzle.
Configure Dozzle in Docker ComposeAdd the following services to your Docker Compose file:
Copy
Ask AI
services: # Setup service to initialize user data setup: image: busybox restart: "no" volumes: - dozzle-data:/dozzle-data/ command: > sh -c 'echo "use authority token" | base64 -d > /dozzle-data/users.yml || true' # Dozzle log viewer service dozzle: container_name: dozzle image: amir20/dozzle:latest depends_on: - setup environment: - DOZZLE_AUTH_PROVIDER=simple volumes: - /var/run/docker.sock:/var/run/docker.sock - dozzle-data:/data/ ports: - 8080:8080
Access Protected LogsOnce deployed, you can access the logs through the container’s public endpoint using the credentials you configured. Only authorized users with the correct username and password will be able to view the logs.