Skip to content

Commit e2bd2c1

Browse files
authored
LocalVisage: Add Docker instructions (#629)
1 parent e713635 commit e2bd2c1

File tree

3 files changed

+65
-3
lines changed

3 files changed

+65
-3
lines changed

plugins/LocalVisage/Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Use any base image based on glibc symbols (basically ubuntu/debian instead of alpine)
2+
FROM python:3.10-slim AS app
3+
4+
# Choose which stash version you want here
5+
COPY --from=stashapp/stash:latest /usr/bin/stash /usr/bin/stash
6+
# COPY --from=stashapp/stash:development /usr/bin/stash /usr/bin/stash
7+
8+
# Git has been added from stash's Dockerfile
9+
RUN apt-get update && apt-get install -y --no-install-recommends \
10+
ca-certificates ffmpeg libvips-tools tzdata git \
11+
&& rm -rf /var/lib/apt/lists/*
12+
13+
RUN pip install --no-cache-dir \
14+
mechanicalsoup \
15+
cloudscraper \
16+
stashapp-tools
17+
18+
ENV STASH_CONFIG_FILE=/root/.stash/config.yml
19+
20+
# 7860 is the port used by deepface server
21+
EXPOSE 7860/tcp
22+
EXPOSE 9999/tcp
23+
CMD ["stash"]
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
services:
2+
stash:
3+
image: stashapp/stash:LocalVisage
4+
container_name: stash
5+
build:
6+
context: .
7+
dockerfile: Dockerfile
8+
restart: unless-stopped
9+
ports:
10+
- "7860:7860"
11+
- "9999:9999"
12+
volumes:
13+
- "./config:/appdata"
14+
- "./data:/data"

plugins/LocalVisage/readme.md

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,39 @@ A plugin for recognizing performers from their images using [DeepFace](https://g
2020

2121
## 📦 Requirements
2222

23-
- Warning: user reported that the dependencies are not available on the docker version of stash. You'd need to make a different docker with source build dependencies and I don't know how to
24-
25-
2623
- Python 3.10.11 (temporarily, see instructions below)
2724
- `PythonDepManager`
2825
- `stashUserscriptLibrary7djx1qp` (add repo https://7djx1qp.github.io/stash-plugins)
2926
- `git` need to be installed and in the PATH
3027

28+
### Docker Usage
29+
30+
Because this plugin relies on tensorflow (the AI framework used), the official Stash docker image can't be used.
31+
See [this post](https://discourse.stashapp.cc/t/local-visage/2478/15?u=jeanpierremartinez81) for details.
32+
33+
A Dockerfile has been created as a replacement to use compatible dependencies.
34+
You can find it in the [plugin repository](https://github.com/stashapp/CommunityScripts/tree/main/plugins/LocalVisage).
35+
36+
You have two options to use this image:
37+
38+
- A working docker compose can be found in the plugin folder.
39+
- Only changes are the build section to use the modified Dockerfile, and a new port to expose that is the deepface server port (7860)
40+
- Use this command to rebuild your docker container: `docker compose up -d --build --pull always`
41+
- Build the image yourself
42+
- Run this to build it inside the plugin repo folder: `docker build --pull -t stashapp/stash:LocalVisage -f Dockerfile .`
43+
- Update your stash container configuration to expose a new port: `docker run -p 7860:7860 ... stashapp/stash:LocalVisage ...`
44+
45+
Once this image is built and running, you can skip the "Set Python Path" step below and enjoy the plugin!
46+
47+
> [!NOTE]
48+
> If you use a reverse proxy, you may encounter difficulties setting up the redirection to the deepface server.
49+
>
50+
> URL used by the plugin is hardcoded inside the `frontend.js` file:<br>
51+
> `window.location.protocol + "//" + window.location.hostname + ":7860"`
52+
>
53+
> e.g. using `https://stash.example.org` will send requests to `https://stash.example.org:7860`.<br>
54+
> But worse, using `https://example.com/stash` will use `https://example.com:7860`
55+
3156
## ⚙️ Tasks
3257

3358
| Task | Description |

0 commit comments

Comments
 (0)