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

This commit is contained in:
Stefan Forstenlechner 2024-09-03 12:51:03 +02:00
parent 525dc171d9
commit 4eaf38d4bb
2 changed files with 44 additions and 7 deletions

View File

@ -2,6 +2,14 @@
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](https://www.docker.com/).
Simple Picture Gallery is a modern looking web app due to [Material UI](https://mui.com/material-ui/), [React Photo Album](https://react-photo-album.com/) and [Yet Another React Lightbox](https://yet-another-react-lightbox.com/).
## Screenshots
![Simple Picture Gallery](doc/images/main.png)
## Getting Started
### Information
@ -10,11 +18,11 @@ Folders should only contain images and folders. Folders should not contain any o
### Docker
The easiest way to run simple picture gallery is with docker.
An easy way to run simple picture gallery is with docker.
```shell
docker build . -t simple-picture-gallery
docker run -p 3005:3001 -v /mnt/path/to/pictures:/usr/src/app/public --name my-picture-gallery simple-picture-gallery
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
```
#### Customization
@ -30,12 +38,34 @@ VITE_FAVICON_HREF=<URL to your favicon>
And run docker with `--env-file .env`
```shell
docker run -p 3005:3001 -v C:/DATA/temp/bla:/usr/src/app/public --env-file .env --name my-picture-gallery simple-picture-gallery
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 compose
Even easier to run it using docker compose.
```dockerfile
services:
gallery:
image: gitea.forstenlechner.dev/stefan/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"
```
### nginx
It is recommended to use a cache for the API calls so that not every request has to read the file system again.
It is recommended to use a cache for the API calls so that not every request has to read from your file system again.
In case you are using nginx as reverse proxy already, here is an example config with a cache.
```nginx
http {
@ -52,12 +82,19 @@ http {
location ~ /(images|directories|folderspreview) {
proxy_cache picture_gallery_cache;
proxy_cache_valid 200 302 600m;
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](https://nginx.org/en/docs/http/ngx_http_proxy_module.html) for more details and parameters.

BIN
doc/images/main.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 KiB