Sign inSign up

bbdrummer/ebook-browser

By bbdrummer

Updated 2 months ago

Browse your EPUB and PDF collection through a browser interface with full EPUB reading capabilities

Image
0

1.8K

bbdrummer/ebook-browser repository overview

Ebook Browser - Docker Deployment

🐳 Docker Features

  • Multi-stage build: Optimized image size with separate build and runtime stages
  • Security-focused: Non-root user, read-only filesystem, no new privileges
  • Health checks: Built-in container health monitoring
  • Alpine Linux: Minimal attack surface with small image size

🚀 Docker Usage

Documentation: https://gitlab.bjoernbartels.earth/golang/ebook-browser/-/wikis/home

Build the Image
# Build the Docker image
docker build -t ebook-browser:latest .

# Or use the helper script
./build-docker.sh
Run with Docker
# Run the container
docker run -d \
  --name ebook-browser \
  -p 8080:8080 \
  -v /path/to/your/books:/app/books:ro \
  ebook-browser:latest

# Access at http://localhost:8080
Run with Docker Compose
# Start the service
docker-compose up -d

# View logs
docker-compose logs -f

# Stop the service
docker-compose down

📁 Volume Mounting

Mount your books directory to /app/books inside the container:

# Example for macOS/Linux
-v /Users/username/Books:/app/books:ro

# Example for Windows
-v C:\Users\username\Books:/app/books:ro

Note: The :ro flag mounts the volume as read-only for security.

🔧 Environment Variables

VariableDefaultDescription
BOOKS_PATH/app/booksPath to books directory
PORT8080Server port

🔒 Security Features

  • Non-root user: Runs as appuser (UID 1001)
  • Read-only filesystem: Container filesystem is immutable
  • No new privileges: Prevents privilege escalation
  • Health checks: Monitors application health
  • Minimal base image: Alpine Linux reduces attack surface

📊 Container Stats

  • Image size: ~15-20MB (Alpine + Go binary)
  • Memory usage: ~20-50MB runtime
  • CPU usage: Minimal when idle
  • Startup time: ~2-5 seconds

🐛 Troubleshooting

Check container logs
docker logs ebook-browser
Health check status
docker inspect ebook-browser --format='{{.State.Health.Status}}'
Enter container for debugging
docker exec -it ebook-browser sh
Verify volume mount
docker exec ebook-browser ls -la /app/books

🔄 Updates

# Pull latest code
git pull

# Rebuild image
docker build -t ebook-browser:latest .

# Recreate container
docker-compose down && docker-compose up -d

Tag summary

Content type

Image

Digest

sha256:d0933a2f1

Size

43.3 MB

Last updated

2 months ago

docker pull bbdrummer/ebook-browser