Traxic Claude Opus 5.5 commited on
Commit
4440265
·
1 Parent(s): c7e9a2d

Add Windows launcher, Dockerfile and release docs

Browse files

run.bat creates a venv, installs dependencies and opens the app.
Dockerfile runs the app as a non-root user on port 8501.
pytest moved to requirements-dev.txt to keep runtime images small.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Files changed (8) hide show
  1. .dockerignore +9 -0
  2. .streamlit/config.toml +0 -3
  3. DISCLOSURE.md +2 -1
  4. Dockerfile +22 -0
  5. README.md +12 -1
  6. requirements-dev.txt +2 -0
  7. requirements.txt +0 -1
  8. run.bat +23 -0
.dockerignore ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ .venv
2
+ .git
3
+ __pycache__
4
+ *.pyc
5
+ .pytest_cache
6
+ .env
7
+ audit_log.jsonl
8
+ data/
9
+ tests/
.streamlit/config.toml CHANGED
@@ -1,8 +1,5 @@
1
  [theme]
2
  primaryColor = "#e63946"
3
 
4
- [server]
5
- headless = true
6
-
7
  [browser]
8
  gatherUsageStats = false
 
1
  [theme]
2
  primaryColor = "#e63946"
3
 
 
 
 
4
  [browser]
5
  gatherUsageStats = false
DISCLOSURE.md CHANGED
@@ -21,7 +21,8 @@ Pərdə does not depend on any third-party PII library. The general approach (pa
21
  |---|---|---|
22
  | streamlit | Apache-2.0 | Web UI |
23
  | openai (Python SDK) | Apache-2.0 | Client for OpenAI-compatible APIs |
24
- | pytest | MIT | Unit tests |
 
25
 
26
  ## Assistance
27
  The code and documentation were written with the help of an AI coding assistant (Claude).
 
21
  |---|---|---|
22
  | streamlit | Apache-2.0 | Web UI |
23
  | openai (Python SDK) | Apache-2.0 | Client for OpenAI-compatible APIs |
24
+ | pytest | MIT | Unit tests (dev only) |
25
+ | python:3.12-slim Docker base image | PSF and Debian licences | Container build |
26
 
27
  ## Assistance
28
  The code and documentation were written with the help of an AI coding assistant (Claude).
Dockerfile ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.12-slim
2
+
3
+ ENV PYTHONDONTWRITEBYTECODE=1 \
4
+ PYTHONUNBUFFERED=1 \
5
+ PERDE_AUDIT=/tmp/audit_log.jsonl
6
+
7
+ WORKDIR /app
8
+ COPY requirements.txt .
9
+ RUN pip install --no-cache-dir -r requirements.txt
10
+
11
+ COPY perde/ perde/
12
+ COPY eval/results.json eval/results.json
13
+ COPY app.py .
14
+ COPY .streamlit/ .streamlit/
15
+
16
+ # Run as a non-root user (also required by Hugging Face Spaces)
17
+ RUN useradd -m -u 1000 perde
18
+ USER perde
19
+
20
+ EXPOSE 8501
21
+ HEALTHCHECK CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8501/_stcore/health')"
22
+ CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0", "--server.headless=true"]
README.md CHANGED
@@ -89,9 +89,20 @@ Generic PII filters are built for English. Azerbaijani personal data has its own
89
 
90
  ## Run it
91
 
 
 
 
 
 
 
 
 
 
 
 
92
  ```bash
93
  python -m venv .venv
94
- .venv/Scripts/pip install -r requirements.txt # Windows; use .venv/bin/pip on Linux/macOS
95
  .venv/Scripts/streamlit run app.py
96
  ```
97
 
 
89
 
90
  ## Run it
91
 
92
+ **Windows, one click:** download the v1.0 release zip, unzip it and double-click `run.bat`. It needs Python 3.10 or newer. The first run installs the dependencies, then the app opens at http://localhost:8501.
93
+
94
+ **Docker (any OS, suits on-premises servers):**
95
+
96
+ ```bash
97
+ docker build -t perde .
98
+ docker run -p 8501:8501 perde
99
+ ```
100
+
101
+ **Manual:**
102
+
103
  ```bash
104
  python -m venv .venv
105
+ .venv/Scripts/pip install -r requirements-dev.txt # Windows; use .venv/bin/pip on Linux/macOS
106
  .venv/Scripts/streamlit run app.py
107
  ```
108
 
requirements-dev.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ -r requirements.txt
2
+ pytest>=8
requirements.txt CHANGED
@@ -1,3 +1,2 @@
1
  streamlit>=1.40
2
  openai>=1.40
3
- pytest>=8
 
1
  streamlit>=1.40
2
  openai>=1.40
 
run.bat ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @echo off
2
+ REM Perde - one-click launcher for Windows
3
+ cd /d "%~dp0"
4
+
5
+ where py >nul 2>nul && (set PY=py -3) || (set PY=python)
6
+ %PY% --version >nul 2>nul || (
7
+ echo Python 3.10+ is required. Install it from https://www.python.org/downloads/ and tick "Add to PATH".
8
+ pause
9
+ exit /b 1
10
+ )
11
+
12
+ if not exist .venv (
13
+ echo Creating virtual environment...
14
+ %PY% -m venv .venv || (pause & exit /b 1)
15
+ )
16
+
17
+ echo Installing dependencies (first run takes a minute)...
18
+ .venv\Scripts\python -m pip install --quiet --disable-pip-version-check -r requirements.txt || (pause & exit /b 1)
19
+
20
+ echo Starting Perde at http://localhost:8501 ...
21
+ start "" cmd /c "timeout /t 5 >nul & start http://localhost:8501"
22
+ .venv\Scripts\python -m streamlit run app.py --server.headless=true
23
+ pause