File size: 1,259 Bytes
e73506b
 
 
 
 
 
 
 
 
bf82ccb
e73506b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2ec63e1
e73506b
 
2ec63e1
e73506b
 
 
 
 
 
 
 
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
FROM python:3.10-slim

WORKDIR /app

# Install system dependencies required for compilation and Gymnasium rendering
RUN apt-get update && apt-get install -y --no-install-recommends \
    build-essential \
    curl \
    git \
    libgl1 \
    libglib2.0-0 \
    && rm -rf /var/lib/apt/lists/*

# Copy and install python dependencies first to cache this layer
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade pip && \
    pip install --no-cache-dir -r requirements.txt

# Create necessary directories
RUN mkdir -p models data artifacts/saes

# Copy trained model weights and SAE features
COPY models/mini_dt.pt ./models/mini_dt.pt
COPY artifacts/saes/ ./artifacts/saes/

# Bake in the lightweight demo trajectories as the default dataset
COPY data/trajectories_demo.pt ./data/trajectories.pt

# Copy codebase
COPY src/ ./src/

# Expose default Streamlit port
EXPOSE 7860

# Streamlit configurations for production/cloud environments
ENV STREAMLIT_SERVER_PORT=7860
ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0
ENV STREAMLIT_SERVER_HEADLESS=true
ENV STREAMLIT_SERVER_ENABLE_CORS=false
ENV STREAMLIT_SERVER_ENABLE_XSRF=true
ENV STREAMLIT_BROWSER_GATHER_USAGE_STATS=false

# Start the dashboard application
CMD ["streamlit", "run", "src/dashboard/app.py"]