Docker Snap - Image and Video Gallery
2.9K
A lightweight, containerized media gallery built with Python Flask. Display your local images and videos as thumbnails with adjustable sizes, view images in fullscreen slideshow mode, or play videos with built-in controls. Works on and desktop and phones and supports easy navigation via either swiping or keyboard.
Create a docker-compose.yml file:
version: '3.8'
services:
docker-snap:
image: nerwander/docker-snap:latest
container_name: docker-snap
ports:
- "5000:5000"
volumes:
- ./sample-images:/images:ro
environment:
- GALLERY_USERNAME=user
- GALLERY_PASSWORD=password
- SECRET_KEY=your-secret-key-change-this-in-production
restart: unless-stopped
healthcheck:
test: ["CMD", "python", "-c", "import requests; requests.get('http://localhost:5000/health', timeout=5)"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
Then run:
# Create images directory and start the gallery
mkdir sample-images
docker-compose up -d
# Visit http://localhost:5000 (default login: user/password)
docker run -d \
--name docker-snap \
-p 5000:5000 \
-v /path/to/your/images:/images:ro \
-e GALLERY_USERNAME=your-username \
-e GALLERY_PASSWORD=your-password \
-e SECRET_KEY=your-secret-key \
--restart unless-stopped \
nerwander/docker-snap:latest
Windows PowerShell:
docker run -d `
--name docker-snap `
-p 5000:5000 `
-v "C:\Users\YourName\Pictures:/images:ro" `
-e GALLERY_USERNAME=admin `
-e GALLERY_PASSWORD=mypassword `
nerwander/docker-snap:latest
| Variable | Default | Description |
|---|---|---|
GALLERY_USERNAME | user | Username for gallery access |
GALLERY_PASSWORD | password | Password for gallery access |
SECRET_KEY | your-secret-key-change-this-in-production | Flask session secret key |
Important: Change the default credentials and secret key in production!
Mount your media directory to /images in the container:
:ro flag for security-v "$HOME/Pictures:/images:ro"-v "C:\Users\YourName\Pictures:/images:ro"Images: PNG, JPEG, GIF, BMP, and WebP files are automatically detected and displayed.
Videos: MP4, WebM, AVI, MOV, MKV, MPEG, M4V, and OGG video files are supported with auto-generated thumbnails.
| Size | Pixels | Description |
|---|---|---|
| 1 | 100px | Tiny |
| 2 | 150px | Small |
| 3 | 200px | Medium |
| 4 | 300px | Large |
| 5 | 400px | Extra Large |
docker logs docker-snaphttp://localhost:5000/healthdocker stats docker-snapMIT License - See repository for full details.
Need more advanced configuration? Check the full documentation in the GitHub repository.
Content type
Image
Digest
sha256:a331d140c…
Size
130.2 MB
Last updated
2 months ago
docker pull nerwander/docker-snap