diff --git a/README.md b/README.md index c7508db..9c0fce5 100644 --- a/README.md +++ b/README.md @@ -8,21 +8,33 @@ Simple Picture Gallery is a modern looking web app due to [Material UI](https:// ## Screenshots +### Desktop + ![Simple Picture Gallery](doc/images/main.png) +![Simple Picture Gallery lightbox](doc/images/lightbox.png) + +### Mobile + +![Simple Picture Gallery mobile](doc/images/mainMobile.png) + +![Simple Picture Gallery mobile with drawer](doc/images/mobileWithDrawer.png) + +![Simple Picture Gallery mobile lightbox](doc/images/mobileLightbox.png) + ## Getting Started ### Information -Folders should only contain images and folders. Folders should not contain any other files. +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. ```shell -docker pull gitea.forstenlechner.dev/stefan/simple-picture-gallery:latest -docker run -p 3005:3001 -v /mnt/path/to/pictures:/usr/src/app/public --name my-picture-gallery gitea.forstenlechner.dev/stefan/simple-picture-gallery:latest +docker pull docker pull ghcr.io/t-h-e/simple-picture-gallery:latest +docker run -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 @@ -38,17 +50,17 @@ VITE_FAVICON_HREF= And run docker with `--env-file .env` ```shell -docker run -p 3005:3001 -v /mnt/path/to/pictures:/usr/src/app/public --env-file .env --name my-picture-gallery gitea.forstenlechner.dev/stefan/simple-picture-gallery:latest +docker run -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 +### Docker Compose Even easier to run it using docker compose. ```dockerfile services: gallery: - image: gitea.forstenlechner.dev/stefan/simple-picture-gallery:latest + image: ghcr.io/t-h-e/simple-picture-gallery:latest container_name: my-picture-gallery environment: # customize your gallery @@ -61,10 +73,18 @@ services: - "3005:3001" ``` -### nginx +### 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. ```nginx @@ -82,6 +102,7 @@ http { location ~ /(images|directories|folderspreview) { proxy_cache picture_gallery_cache; + # cache is valid for 60 minutes. Reduce or increase this time according to your needs. proxy_cache_valid 200 302 60m; proxy_cache_min_uses 1; proxy_pass http://127.0.0.1:3005; @@ -97,4 +118,7 @@ http { > **_NOTE:_** `proxy_cache_path` and `proxy_cache` need to use the same zone. See [nginx documentation](https://nginx.org/en/docs/http/ngx_http_proxy_module.html) for more details and parameters. - \ No newline at end of file + +--- + +Photos from [Unsplash](https://unsplash.com) diff --git a/doc/images/lightbox.png b/doc/images/lightbox.png new file mode 100644 index 0000000..9328dad Binary files /dev/null and b/doc/images/lightbox.png differ diff --git a/doc/images/main.png b/doc/images/main.png index c1c6b78..1bfc5b1 100644 Binary files a/doc/images/main.png and b/doc/images/main.png differ diff --git a/doc/images/mainMobile.png b/doc/images/mainMobile.png new file mode 100644 index 0000000..7611f6c Binary files /dev/null and b/doc/images/mainMobile.png differ diff --git a/doc/images/mobileLightbox.png b/doc/images/mobileLightbox.png new file mode 100644 index 0000000..cfeace6 Binary files /dev/null and b/doc/images/mobileLightbox.png differ diff --git a/doc/images/mobileWithDrawer.png b/doc/images/mobileWithDrawer.png new file mode 100644 index 0000000..9016946 Binary files /dev/null and b/doc/images/mobileWithDrawer.png differ