Go to file
Stefan Forstenlechner 31e3162c48
Build and publish docker image snapshot / build-and-publish (push) Successful in 1m27s Details
Change FolderGallery to rows layout
In column layout the folders are ordered by column.
Row layout is the correct one to choose, but it has weird behaviour
 regarding row height. Changed `targetRowHeight` so that it hopefully
 behaves a little nicer.
2024-09-23 23:16:11 +02:00
.gitea/workflows Push image to GHCR 2024-09-03 14:29:29 +02:00
doc/images Update README 2024-09-04 12:10:26 +02:00
picture-gallery-client Change FolderGallery to rows layout 2024-09-23 23:16:11 +02:00
picture-gallery-server Activate typescript strict mode for server 2024-09-04 20:29:23 +02:00
public Rename image folders 2024-09-03 12:44:42 +02:00
.dockerignore Add some sensible sorting 2022-05-26 23:05:48 +02:00
.gitignore integrate lighthouse 2022-08-08 17:34:32 +02:00
Dockerfile Get rid of some warnings 2024-09-04 12:09:08 +02:00
LICENSE Add MIT license 2024-09-03 12:41:47 +02:00
README.md Activate typescript strict mode for server 2024-09-04 20:29:23 +02:00
package.json Add MIT license 2024-09-03 12:41:47 +02:00

README.md

Simple Picture Gallery

A simple picture gallery. No database required. Photos can simply be stored in your file system. Add and remove photos. Simple picture gallery will automatically show them and create thumbnails.

All you need is your photos and docker.

Simple Picture Gallery is a modern looking web app due to Material UI, React Photo Album and Yet Another React Lightbox.

Screenshots

Desktop

Simple Picture Gallery

Simple Picture Gallery lightbox

Mobile

Simple Picture Gallery mobile

Simple Picture Gallery mobile with drawer

Simple Picture Gallery mobile lightbox

Getting Started

Information

Folders should only contain images and other folders. Folders should not contain any other files.

Docker

An easy way to run simple picture gallery is with docker.

docker pull docker pull ghcr.io/t-h-e/simple-picture-gallery:latest
docker run -d -p 3005:3001 -v /mnt/path/to/pictures:/usr/src/app/public --name my-picture-gallery ghcr.io/t-h-e/simple-picture-gallery:latest

Customization

Create an environment file .env containing any of the following properties to customize your gallery. All properties are optional.

VITE_TITLE=My Gallery
VITE_APPBAR_COLOR=#F8AB2D
VITE_FAVICON_HREF=<URL to your favicon or remove this property>

And run docker with --env-file .env

docker run -d -p 3005:3001 -v /mnt/path/to/pictures:/usr/src/app/public --env-file .env --name my-picture-gallery ghcr.io/t-h-e/simple-picture-gallery:latest

Docker Compose

Even easier to run it using docker compose.

services:
  gallery:
    image: ghcr.io/t-h-e/simple-picture-gallery:latest
    container_name: my-picture-gallery
    environment:
      # customize your gallery
      - VITE_TITLE=My Gallery
      - VITE_APPBAR_COLOR=#F8AB2D
    restart: always
    volumes:
      - /mnt/path/to/pictures/:/usr/src/app/public
    ports:
      - "3005:3001"

Hint

On first startup, the application is going to create thumbnails of all images. This can lead to heavy CPU usage. Thumbnails for images that are added after starting the application are created on the fly.

Thumbnails are stored in a folder .thumbnail in the mounted folder. In case you want to remove simple picture gallery at some point. Simply remove the container and delete the .thumbnail folder.

Configure a cache with nginx

It is recommended to use a cache for the API calls so that not every request has to read from your file system again.

When using a cache, new images may not be available straight away as previous requests are then obviously cached. Set the cache timeout accordingly.

In case you are using nginx as reverse proxy already, here is an example config with a cache.

http {
  proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=picture_gallery_cache:10m max_size=100m inactive=60m use_temp_path=off;

  server {
    ...

    location / {
       proxy_pass http://127.0.0.1:3005;
    }

    location ~ /(images|directories|folderspreview) {
       proxy_cache picture_gallery_cache;
       # cache is valid for 60 minutes. Increase or decrease according to your needs.
       proxy_cache_valid 200 302 60m;
       proxy_cache_min_uses 1;
       proxy_pass http://127.0.0.1:3005;
    }

    server_name gallery.domain.com
    ...
  }
}

NOTE: proxy_cache_path and proxy_cache need to use the same zone.

See nginx documentation for more details and parameters.


Photos from Unsplash