Compare commits

...

3 Commits

Author SHA1 Message Date
Stefan Forstenlechner 69d08b0c7a 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)
2024-09-04 12:10:26 +02:00
Stefan Forstenlechner 0c8588b1fb Minor style fix 2024-09-04 12:09:24 +02:00
Stefan Forstenlechner eb9969f2ba Get rid of some warnings 2024-09-04 12:09:08 +02:00
8 changed files with 35 additions and 11 deletions

View File

@ -1,4 +1,4 @@
FROM node:22.2.0-alpine as client-builder
FROM node:22.2.0-alpine AS client-builder
COPY picture-gallery-client/package*.json /usr/src/app/picture-gallery-client/
WORKDIR /usr/src/app/picture-gallery-client
@ -14,7 +14,7 @@ RUN mkdir built && \
cp .env built && \
npm ci --prefix ./built --only=production
FROM node:22.2.0-alpine as server-builder
FROM node:22.2.0-alpine AS server-builder
COPY picture-gallery-server/package*.json /usr/src/app/picture-gallery-server/
WORKDIR /usr/src/app/picture-gallery-server

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

View File

@ -72,7 +72,7 @@ export const ImageGalleryMain = ({
</>
)}
{images.length > 0 && foldersPreview.length > 0 && (
<Divider style={{ marginBottom: "10px" }}>
<Divider style={{ marginBottom: "10px", marginTop: "10px" }}>
<Chip label="Images" size="small" />
</Divider>
)}