File size: 883 Bytes
80f1cb1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8eac0b6
 
 
 
 
80f1cb1
 
 
 
 
 
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
FROM python:3.11-slim

ENV PYTHONUNBUFFERED=1 \
    PIP_NO_CACHE_DIR=1 \
    TRANSFORMERS_CACHE=/app/.cache/huggingface \
    HF_HOME=/app/.cache/huggingface

RUN apt-get update && apt-get install -y --no-install-recommends \
        build-essential \
        git \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /app

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy all backend modules (.dockerignore excludes __pycache__, .venv, etc.):
#   main.py, model.py, research.py, refusal_pairs.py, over_refusal_pairs.py
#   refusal_bench/ (the bench harness + 6 techniques + harmfulness probe)
#   scripts/ (the data build scripts; not invoked at runtime but committed)
COPY . .

RUN mkdir -p /app/.cache/huggingface && chmod -R 777 /app/.cache

EXPOSE 7860

CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--timeout-keep-alive", "120"]