File size: 1,213 Bytes
c2c45bb
 
cdf485e
c2c45bb
cdf485e
 
 
c2c45bb
cdf485e
 
c2c45bb
cdf485e
 
c2c45bb
 
 
 
 
 
 
 
 
 
 
 
 
 
e0b4973
 
cdf485e
 
c2c45bb
cdf485e
 
 
 
c2c45bb
fe3f40d
0123767
 
cdf485e
 
fe3f40d
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
# PreferenceLab — OpenEnv RLHF Environment
# Hugging Face Spaces compatible Docker image

FROM python:3.10-slim

WORKDIR /app

# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
    git \
    curl \
    && rm -rf /var/lib/apt/lists/*

# Copy project files
COPY . /app

# Install Python dependencies directly with pip
# Pin versions to match requirements.txt for reproducibility
RUN pip install --no-cache-dir \
    "openenv-core>=0.2.1" \
    "fastapi>=0.104.0" \
    "uvicorn>=0.24.0" \
    "pydantic>=2.0.0" \
    "openai>=1.0.0" \
    "datasets>=2.14.0" \
    "httpx>=0.25.0" \
    "websockets>=11.0" \
    "gradio>=4.0.0" \
    "pandas>=2.0.0"

# Environment
ENV PYTHONPATH="/app:$PYTHONPATH"
ENV ENABLE_WEB_INTERFACE=true
ENV MAX_CONCURRENT_ENVS=64

# Health check
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 \
    CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:7860/health')" || exit 1
# Prepare real datasets during build (ignore errors to fallback to synthetic)
RUN python scripts/prepare_datasets.py || true

# Start server
CMD ["uvicorn", "server.app:app", "--host", "0.0.0.0", "--port", "7860"]