This Docker container captures screenshots of a webpage at configurable intervals and serves them via a simple web interface, perfect for displaying on older devices that can't handle modern web technologies.
- Build and run with Docker Compose:
docker-compose up -d- Access the screenshot viewer at:
http://localhost:8080
services:
screenshot-server:
image: flucko/screenshot-server:latest
ports:
- "8080:80"
environment:
- TARGET_URL=http://example.com/
- RESOLUTION=1024x768
- SCREENSHOT_INTERVAL=60
restart: unless-stopped
volumes:
- screenshot-data:/var/www/html
volumes:
screenshot-data:Edit the environment variables in docker-compose.yml:
| Variable | Default | Description |
|---|---|---|
TARGET_URL |
http://192.168.0.121:8180/ |
The webpage to capture |
RESOLUTION |
1024x768 |
Screenshot resolution (WIDTHxHEIGHT) |
SCREENSHOT_INTERVAL |
60 |
Screenshot frequency in minutes |
PAGE_LOAD_DELAY |
10 |
Wait time in seconds before capturing |
TZ |
America/Toronto |
Timezone for timestamps |
IMAGE_FORMAT |
jpeg |
Output format: jpeg or webp |
IMAGE_QUALITY |
80 |
Compression quality (1-100) |
Example resolutions for older iPads:
- iPad 1/2:
1024x768 - iPad 3/4:
2048x1536 - iPad Mini 1:
1024x768
Example intervals:
5- Every 5 minutes30- Every 30 minutes60- Every hour (default)1440- Once daily
- Takes a screenshot of the target URL at specified intervals using headless Chromium
- Converts to optimized JPEG (or WebP) for minimal file size
- Serves the screenshot at
/latest.jpgwith an auto-refreshing HTML viewer - Managed by Supervisord: nginx + cron + initial screenshot on startup
# Build the image
docker build -t screenshot-server .
# Run the container
docker run -d \
-p 8080:80 \
-e TARGET_URL="http://192.168.0.121:8180/" \
-e RESOLUTION="1024x768" \
-e SCREENSHOT_INTERVAL="60" \
-e PAGE_LOAD_DELAY="10" \
-e TZ="America/Toronto" \
screenshot-serverOn every push to main:
- Builds multi-architecture images (amd64 and arm64)
- Publishes to Docker Hub as
flucko/screenshot-server:latest - Semver tags (
v1.2.3) also create versioned images
- Single image: The separate Alpine and Ubuntu image variants have been removed. There is now a single Alpine-based image (
latest). If you were usingdocker-compose.alpine.yml, switch todocker-compose.yml. - JPEG output: Screenshots are now saved as
latest.jpginstead oflatest.pngby default. SetIMAGE_FORMAT=webpfor WebP output. Theindex.htmlviewer handles this automatically. - Chrome persistence removed: The
KEEP_CHROME_OPEN,CHROME_MAX_MEMORY_MB, andCHROME_RESTART_HOURSenvironment variables are no longer supported. Chrome starts fresh for each screenshot.
- Page not fully loaded: Increase
PAGE_LOAD_DELAYvalue - Wrong timezone: Set
TZenvironment variable in docker-compose.yml - View logs:
docker-compose logs -f - Check cron:
docker exec <container-id> crontab -l - Check processes:
docker exec <container-id> supervisorctl status