File size: 900 Bytes
4ead231
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Dockerfile used by HF Spaces (SDK: docker).
# HF Spaces conventions:
#   - listen on 0.0.0.0:7860
#   - run as a non-root UID 1000
#
# Runtime env (set via Space "Secrets / Variables"):
#   HF_TOKEN              write token (secret) — used to push reviews
#   REVIEW_DATASET_REPO   e.g. VCLab-PolyU/omnistg-reviews
#   ANNO_REVIEWS_TARGET   default 3 (each annotation needs N reviews)

FROM python:3.11-slim

ENV PYTHONDONTWRITEBYTECODE=1 \
    PYTHONUNBUFFERED=1 \
    PIP_DISABLE_PIP_VERSION_CHECK=1

WORKDIR /app

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

COPY scripts ./scripts
COPY templates ./templates
COPY static ./static
COPY data ./data

# Make data writable for local fallback (data/local_reviews/).
RUN mkdir -p /app/data/local_reviews && chmod -R 777 /app/data

EXPOSE 7860

CMD ["uvicorn", "scripts.web:app", "--host", "0.0.0.0", "--port", "7860"]