Skip to content

Commit

Permalink
Fix docker and update deps (#107)
Browse files Browse the repository at this point in the history
* Fix some docker configuration generation as well as incorrect README

* update and cleanup deps
  • Loading branch information
cbenning committed Mar 6, 2023
1 parent 20c853f commit 0346e35
Show file tree
Hide file tree
Showing 8 changed files with 309 additions and 379 deletions.
40 changes: 21 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Fussel
Fussel

![License Badge](https://img.shields.io/github/license/cbenning/fussel)
![Version Badge](https://img.shields.io/github/v/release/cbenning/fussel)
Expand All @@ -9,7 +9,7 @@ with nothing but a directory full of photos.
**[Demo Site](https://benninger.ca/fussel-demo/)**

Features and Properties:
- Zero no server-side code to worry about once generated
- No server-side code to worry about once generated
- Builds special "Person" gallery for people found in XMP face tags.
- Adds watermarks
- Mobile friendly
Expand Down Expand Up @@ -112,26 +112,28 @@ Optional:

```
docker run \
-e PGID=$(id -g) \
-e PUID=$(id -u) \
-v <input_dir>:/input:ro \
-v <output_dir>:/output \
--label gallery.input_path="/input" \
--label gallery.output_path="/output" \
--label gallery.overwrite=False \
--label albums.recursive=True \
--label albums.recursive_name_pattern="{parent_album} > {album}" \
--label people.enable=True \
--label watermark.enable=True \
--label watermark.path="web/src/images/fussel-watermark.png" \
--label watermark.size_ratio=0.3 \
--label site.http_root="/" \
--label site.title="Fussel Gallery" \
-v /var/run/docker.sock:/var/run/docker.sock fussel
-e PGID=$(id -g) \
-e PUID=$(id -u) \
-v /var/run/docker.sock:/var/run/docker.sock \
-v <input_path>:/input:ro \
-v <output_path>:/output \
--label gallery.input_path="/input" \
--label gallery.output_path="/output" \
--label gallery.overwrite=False \
--label gallery.parallel_tasks=4 \
--label gallery.albums.recursive=True \
--label gallery.albums.recursive_name_pattern="{parent_album} > {album}" \
--label gallery.people.enable=True \
--label gallery.watermark.enable=True \
--label gallery.watermark.path="web/src/images/fussel-watermark.png" \
--label gallery.watermark.size_ratio=0.3 \
--label site.http_root="/" \
--label site.title="Fussel Gallery" \
ghcr.io/cbenning/fussel:latest
```

Once complete you can upload the output folder to your webserver, or see what it looks like with
`python -m http.server --directory <output_dir>`
`python -m http.server --directory <output_path>`


## FAQ
Expand Down
13 changes: 6 additions & 7 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@ WORKDIR /fussel

COPY . /fussel/

RUN apk add --no-cache curl jq yq python3 python3-dev py3-pip nodejs yarn sed bash \
libjpeg-turbo libjpeg-turbo-dev zlib zlib-dev libc-dev gcc \
&& ./setup.sh \
&& apk del python3-dev py3-pip libjpeg-turbo-dev zlib-dev libc-dev gcc \
&& rm -r /usr/local/share/.cache
RUN yarn config set disable-self-update-check true
RUN apk add --no-cache curl jq yq python3 python3-dev py3-pip nodejs yarn sed bash && \
apk add --no-cache libjpeg-turbo libjpeg-turbo-dev zlib zlib-dev libc-dev gcc && \
yarn config set disable-self-update-check true && \
./setup.sh && \
apk del python3-dev py3-pip libjpeg-turbo-dev zlib-dev libc-dev gcc && \
rm -r /usr/local/share/.cache

COPY . /fussel
WORKDIR /

COPY docker/start.sh /
Expand Down
10 changes: 0 additions & 10 deletions docker/docker-compose.yml

This file was deleted.

51 changes: 0 additions & 51 deletions docker/nginx.conf

This file was deleted.

2 changes: 1 addition & 1 deletion docker/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
pushd fussel

echo "Generating yaml config..."
curl --silent -XGET --unix-socket /run/docker.sock http://localhost/containers/${HOSTNAME}/json | jq '.Config.Labels' > flat_config.json
curl --silent -XGET --unix-socket /var/run/docker.sock http://localhost/containers/${HOSTNAME}/json | jq '.Config.Labels' > flat_config.json
utils/./flat_json_to_nested_json.py flat_config.json > config.json
yq -P config.json > config.yml
cat config.yml
Expand Down
4 changes: 2 additions & 2 deletions fussel/generator/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ def init(cls, yaml_config):
'gallery.watermark.enable', True))
cls._instance.watermark_path = str(yaml_config.getKey(
'gallery.watermark.path', DEFAULT_WATERMARK_PATH))
cls._instance.watermark_ratio = yaml_config.getKey(
'gallery.watermark.size_ratio', DEFAULT_WATERMARK_SIZE_RATIO)
cls._instance.watermark_ratio = float(yaml_config.getKey(
'gallery.watermark.size_ratio', DEFAULT_WATERMARK_SIZE_RATIO))
cls._instance.recursive_albums = bool(yaml_config.getKey(
'gallery.albums.recursive', True))
cls._instance.recursive_albums_name_pattern = str(yaml_config.getKey(
Expand Down
9 changes: 2 additions & 7 deletions fussel/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,14 @@
"license": "MIT",
"dependencies": {
"bulma": "^0.9.4",
"prop-types": "^15.8.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-helmet": "^6.1.0",
"react-modal": "^3.16.1",
"react-responsive-masonry": "^2.1.7",
"react-router-dom": "^6.8.1",
"react-router-dom": "^6.8.2",
"react-scripts": "^5.0.1",
"serialize-javascript": "^5.0.1",
"swiper": "^9.0.5",
"tsutils": "^3.21.0",
"typescript": "^4.9.5",
"websocket-extensions": "^0.1.4"
"swiper": "^9.1.0"
},
"scripts": {
"start": "react-scripts --openssl-legacy-provider start",
Expand Down
Loading

0 comments on commit 0346e35

Please sign in to comment.