Deploying Sigal
Introduction
Sigal is a static gallery generator written in Python that creates beautiful, responsive photo galleries from your image collection. Unlike dynamic gallery applications, Sigal generates static HTML files that can be served by any web server, resulting in fast, secure, and easy-to-host galleries.
Sigal takes a folder of images and generates a complete gallery with thumbnails, navigation, and optional features like EXIF data display, image maps, and video support. The generated output is pure HTML, CSS, and JavaScript with no server-side processing required.
Key highlights of Sigal:
- Static Output: Generates pure HTML/CSS/JS galleries
- Automatic Thumbnails: Creates optimized thumbnails at configurable sizes
- EXIF Support: Extracts and displays camera metadata
- Video Support: Handles video files in galleries
- Multiple Themes: Customizable themes and templates
- Responsive Design: Galleries work on all screen sizes
- ZIP Downloads: Optional album download functionality
- Markdown Descriptions: Add descriptions with Markdown
- Image Optimization: Resize and compress images automatically
- GPS Mapping: Display photo locations on maps
- Fast Generation: Incremental builds for large galleries
- Open Source: MIT licensed
This guide walks through deploying Sigal on Klutch.sh using Docker, configuring gallery generation, and hosting your static photo galleries.
Why Deploy Sigal on Klutch.sh
Deploying Sigal on Klutch.sh provides several advantages for photo galleries:
Simplified Deployment: Klutch.sh automatically detects your Dockerfile and builds your gallery server. Push to GitHub, and your galleries deploy automatically.
Persistent Storage: Attach persistent volumes for your source images and generated galleries. Your photos and galleries survive container restarts.
HTTPS by Default: Klutch.sh provides automatic SSL certificates for secure photo sharing.
GitHub Integration: Connect your configuration repository directly from GitHub. Updates trigger automatic redeployments.
Static Hosting: The generated galleries are static files served efficiently with minimal resources.
Custom Domains: Assign a custom domain for a professional gallery experience.
Always-On Availability: Your galleries remain accessible 24/7.
Prerequisites
Before deploying Sigal on Klutch.sh, ensure you have:
- A Klutch.sh account
- A GitHub account with a repository for your Sigal configuration
- Basic familiarity with Docker and Python
- Photos you want to display in galleries
- (Optional) A custom domain for your gallery
Understanding Sigal Architecture
Sigal operates as a static site generator:
Python Generator: Sigal processes source images and generates static HTML galleries.
Template System: Jinja2 templates define gallery layout and appearance.
Image Processing: PIL/Pillow handles thumbnail generation and image optimization.
Static Output: The generated gallery is pure HTML/CSS/JS with no runtime dependencies.
Web Server: Any static file server (nginx, Apache) can serve the generated files.
Preparing Your Repository
To deploy Sigal on Klutch.sh, create a GitHub repository with your configuration.
Repository Structure
sigal-deploy/├── Dockerfile├── sigal.conf.py├── .dockerignore└── README.mdCreating the Dockerfile
Create a Dockerfile in the root of your repository:
FROM python:3.11-slim
# Install dependenciesRUN apt-get update && apt-get install -y \ libjpeg-dev \ libpng-dev \ ffmpeg \ nginx \ && rm -rf /var/lib/apt/lists/*
# Install SigalRUN pip install sigal pillow
# Create directoriesRUN mkdir -p /source /output /config
# Copy configurationCOPY sigal.conf.py /config/sigal.conf.py
# Copy nginx configurationRUN echo 'server { \n\ listen 80; \n\ root /output; \n\ location / { \n\ try_files $uri $uri/ =404; \n\ } \n\}' > /etc/nginx/sites-available/default
# Create entrypoint scriptRUN echo '#!/bin/bash\n\sigal build /source /output -c /config/sigal.conf.py\n\nginx -g "daemon off;"' > /entrypoint.sh && \ chmod +x /entrypoint.sh
EXPOSE 80
CMD ["/entrypoint.sh"]Creating the Configuration File
Create a sigal.conf.py file:
# Sigal configuration file
# Source and destination (can be overridden via command line)source = '/source'destination = '/output'
# Theme settingstheme = 'galleria'
# Image settingsimg_size = (1920, 1080)thumb_size = (280, 210)thumb_fit = True
# JPEG quality (1-100)jpg_options = {'quality': 85, 'optimize': True}
# Generate thumbnails for videosmake_thumbs = True
# Show EXIF datashow_exif = True
# Zip galleries for downloadzip_gallery = True
# Title and descriptiontitle = 'My Photo Gallery'description = 'A collection of my photographs'
# Links to original imagesorig_link = True
# Image processingautorotate_images = True
# Files to ignoreignore_directories = ['.git', 'cache']ignore_files = ['*.txt', '*.md', '.DS_Store']
# Localelocale = 'en_US.utf8'
# Google Maps API key for location display (optional)# google_maps_api_key = 'your-api-key'Creating the .dockerignore File
Create a .dockerignore file:
.git.github*.mdLICENSE.gitignore*.log.DS_StoreDeploying Sigal on Klutch.sh
Once your repository is prepared, follow these steps to deploy Sigal:
- Select HTTP as the traffic type
- Set the internal port to 80
- Build the container image with Sigal and nginx
- Attach the persistent volumes
- Start the container
- Provision an HTTPS certificate
Push Your Repository to GitHub
Initialize your repository and push to GitHub:
git initgit add Dockerfile sigal.conf.py .dockerignore README.mdgit commit -m "Initial Sigal deployment configuration"git remote add origin https://github.com/yourusername/sigal-deploy.gitgit push -u origin mainCreate a New Project on Klutch.sh
Navigate to the Klutch.sh dashboard and create a new project. Give it a descriptive name like “sigal” or “photo-gallery”.
Create a New App
Within your project, create a new app. Connect your GitHub account if you haven’t already, then select the repository containing your Sigal Dockerfile.
Configure HTTP Traffic
In the deployment settings:
Attach Persistent Volumes
Add volumes for your photos and generated galleries:
| Mount Path | Recommended Size | Purpose |
|---|---|---|
/source | 100+ GB | Source photos (adjust based on collection) |
/output | 50 GB | Generated gallery files |
Deploy Your Application
Click Deploy to start the build process. Klutch.sh will:
Upload Your Photos
After deployment, upload your photos to the /source volume. Organize them in folders to create albums:
/source/├── 2023-vacation/│ ├── photo1.jpg│ ├── photo2.jpg│ └── description.md├── family-photos/│ └── ...└── index.mdRegenerate Gallery
Restart the container to regenerate the gallery with new photos.
Access Your Gallery
Once generation completes, access your gallery at https://your-app-name.klutch.sh.
Organizing Your Photos
Folder Structure
Create albums using directory structure:
/source/├── 2024/│ ├── january/│ │ ├── event1/│ │ └── event2/│ └── february/├── travel/│ ├── paris/│ └── tokyo/└── index.mdAdding Descriptions
Create index.md files for album descriptions:
# Summer Vacation 2024
Photos from our trip to the beach.
- Location: California Coast- Date: July 2024Image Descriptions
Name files descriptively or add individual descriptions:
sunset-beach.jpgsunset-beach.md # Contains description for this imageConfiguration Options
Theme Selection
Available themes:
| Theme | Description |
|---|---|
| galleria | Modern, responsive gallery with slideshow |
| colorbox | Lightbox-style image viewer |
| photoswipe | Touch-friendly mobile gallery |
Image Sizes
Configure image and thumbnail dimensions:
# Full-size imagesimg_size = (1920, 1080)
# Thumbnailsthumb_size = (280, 210)thumb_fit = True # Crop to exact sizeEXIF Display
Control metadata display:
show_exif = True# Available EXIF fields: aperture, camera, date, exposure, flash,# focal, gps, iso, lens, location, model, software, speedProduction Best Practices
Performance Optimization
- Image Optimization: Original images are automatically optimized
- Thumbnail Caching: Thumbnails are cached between builds
- Lazy Loading: Modern themes support lazy loading
Storage Management
- Source Organization: Keep source photos organized for easy management
- Archive Originals: Keep original photos backed up elsewhere
- Clean Builds: Periodically clean and rebuild if issues occur
Backup Strategy
- Source Photos: Back up
/sourcedirectory with original photos - Configuration: Keep sigal.conf.py in version control
- Generated Output: Can be regenerated from source
Troubleshooting Common Issues
Thumbnails Not Generating
Symptoms: Gallery shows broken thumbnail images.
Solutions:
- Verify Pillow is installed correctly
- Check file permissions on output directory
- Ensure source images are valid JPEG/PNG files
Videos Not Playing
Symptoms: Video files don’t play in gallery.
Solutions:
- Verify ffmpeg is installed
- Check video format compatibility
- Ensure video files aren’t too large
Slow Generation
Symptoms: Gallery takes very long to build.
Solutions:
- Use incremental builds (default behavior)
- Reduce image sizes in configuration
- Process fewer images per album
Additional Resources
- Sigal Documentation
- Sigal GitHub Repository
- Configuration Reference
- Theme Customization
- Klutch.sh Persistent Volumes
- Klutch.sh Deployments
Conclusion
Deploying Sigal on Klutch.sh gives you a fast, secure photo gallery with automatic builds, persistent storage, and secure HTTPS access. The combination of Sigal’s static generation and Klutch.sh’s deployment simplicity means you can share your photos without complex infrastructure.
With automatic thumbnail generation, EXIF support, and responsive themes, Sigal creates professional-looking galleries from your photo collection. The static output means fast loading times and minimal server resources.
Whether you’re sharing vacation photos with family or showcasing your photography portfolio, Sigal on Klutch.sh provides the reliable foundation for beautiful, self-hosted photo galleries.