LocalVisage: Add Docker instructions (#629)

This commit is contained in:
Rémi Marseault 2025-11-12 19:36:52 +01:00 committed by GitHub
parent e7136354ae
commit e2bd2c1b69
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 65 additions and 3 deletions

View File

@ -0,0 +1,23 @@
# Use any base image based on glibc symbols (basically ubuntu/debian instead of alpine)
FROM python:3.10-slim AS app
# Choose which stash version you want here
COPY --from=stashapp/stash:latest /usr/bin/stash /usr/bin/stash
# COPY --from=stashapp/stash:development /usr/bin/stash /usr/bin/stash
# Git has been added from stash's Dockerfile
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates ffmpeg libvips-tools tzdata git \
&& rm -rf /var/lib/apt/lists/*
RUN pip install --no-cache-dir \
mechanicalsoup \
cloudscraper \
stashapp-tools
ENV STASH_CONFIG_FILE=/root/.stash/config.yml
# 7860 is the port used by deepface server
EXPOSE 7860/tcp
EXPOSE 9999/tcp
CMD ["stash"]

View File

@ -0,0 +1,14 @@
services:
stash:
image: stashapp/stash:LocalVisage
container_name: stash
build:
context: .
dockerfile: Dockerfile
restart: unless-stopped
ports:
- "7860:7860"
- "9999:9999"
volumes:
- "./config:/appdata"
- "./data:/data"

View File

@ -20,14 +20,39 @@ A plugin for recognizing performers from their images using [DeepFace](https://g
## 📦 Requirements
- 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
- Python 3.10.11 (temporarily, see instructions below)
- `PythonDepManager`
- `stashUserscriptLibrary7djx1qp` (add repo https://7djx1qp.github.io/stash-plugins)
- `git` need to be installed and in the PATH
### Docker Usage
Because this plugin relies on tensorflow (the AI framework used), the official Stash docker image can't be used.
See [this post](https://discourse.stashapp.cc/t/local-visage/2478/15?u=jeanpierremartinez81) for details.
A Dockerfile has been created as a replacement to use compatible dependencies.
You can find it in the [plugin repository](https://github.com/stashapp/CommunityScripts/tree/main/plugins/LocalVisage).
You have two options to use this image:
- A working docker compose can be found in the plugin folder.
- Only changes are the build section to use the modified Dockerfile, and a new port to expose that is the deepface server port (7860)
- Use this command to rebuild your docker container: `docker compose up -d --build --pull always`
- Build the image yourself
- Run this to build it inside the plugin repo folder: `docker build --pull -t stashapp/stash:LocalVisage -f Dockerfile .`
- Update your stash container configuration to expose a new port: `docker run -p 7860:7860 ... stashapp/stash:LocalVisage ...`
Once this image is built and running, you can skip the "Set Python Path" step below and enjoy the plugin!
> [!NOTE]
> If you use a reverse proxy, you may encounter difficulties setting up the redirection to the deepface server.
>
> URL used by the plugin is hardcoded inside the `frontend.js` file:<br>
> `window.location.protocol + "//" + window.location.hostname + ":7860"`
>
> e.g. using `https://stash.example.org` will send requests to `https://stash.example.org:7860`.<br>
> But worse, using `https://example.com/stash` will use `https://example.com:7860`
## ⚙️ Tasks
| Task | Description |