Update README
Build and publish docker image snapshot / build-and-publish (push) Successful in 1m17s Details

Add additional important hints and info
Add more screenshots
Add reference to Unsplash (although not required by Unsplash)
This commit is contained in:
Stefan Forstenlechner 2024-09-04 12:10:26 +02:00
parent 0c8588b1fb
commit 69d08b0c7a
6 changed files with 32 additions and 8 deletions

View File

@ -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=<URL to your favicon>
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.
---
Photos from [Unsplash](https://unsplash.com)

BIN
doc/images/lightbox.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 329 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 222 KiB

After

Width:  |  Height:  |  Size: 192 KiB

BIN
doc/images/mainMobile.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 288 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB