Repository navigation
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
56 lines (53 loc) · 2.28 KB
/
Copy pathdocker-compose.yaml
File metadata and controls
56 lines (53 loc) · 2.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Scores a redaction policy and then serves the report in a browser.
#
# mkdir -p data/golden data/raw # your gold standard, and the text to score
# export PHILTER_URL=https://philter.internal:8080
# export PHILTER_TOKEN=sk_... # a Philter API key with the redact scope
# docker compose up
#
# The audit runs once and writes report.json and report.html into ./data. The
# dashboard waits for it to finish and then serves the report on port 5000.
#
# Override any of these in the environment or in a .env file next to this file:
#
# PHILTER_URL Philter API to redact the raw text with
# PHILTER_TOKEN Philter API key; Philter 4 requires one
# PHILTER_CA_CERT PEM certificate to trust for Philter's HTTPS, as a
# path inside the container, e.g. /data/philter.pem
# PHILTERSCOPE_VERSION image tag to run
# PHILTERSCOPE_THRESHOLD recall threshold an entity type has to clear
# PHILTERSCOPE_UID/_GID your own id -u and id -g, if they are not 1000
services:
audit:
image: philterd/philter-scope:${PHILTERSCOPE_VERSION:-0.2.0}
# The container runs as a non-root user, so the audit needs your own uid and
# gid to write the report back to the bind-mounted directory.
user: "${PHILTERSCOPE_UID:-1000}:${PHILTERSCOPE_GID:-1000}"
volumes:
- ./data:/data
command:
- philterscope-audit
# Philter serves HTTPS with a self-signed certificate by default. Save it
# into ./data and set PHILTER_CA_CERT to trust it. Input files that are
# already Philter explain JSON are scored without being redacted again.
- --url=${PHILTER_URL:-https://localhost:8080}
- --token=${PHILTER_TOKEN:-}
- --ca-cert=${PHILTER_CA_CERT:-}
- --golden=/data/golden/
- --input=/data/raw/
- --output=/data/
- --threshold=${PHILTERSCOPE_THRESHOLD:-0.75}
dashboard:
image: philterd/philter-scope:${PHILTERSCOPE_VERSION:-0.2.0}
ports:
- "5000:5000"
volumes:
- ./data:/data
command:
- philterscope-serve
# The same threshold the audit used, so the dashboard flags the same
# entity types as failing.
- --threshold=${PHILTERSCOPE_THRESHOLD:-0.75}
depends_on:
audit:
condition: service_completed_successfully