File size: 1,121 Bytes
4904e85
f4ed234
6172160
 
f4ed234
4904e85
f4ed234
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c8b8245
f4ed234
 
 
 
 
 
 
 
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
FROM python:3.11-slim

LABEL org.opencontainers.image.title="911 City-Wide Emergency Dispatch Supervisor"
LABEL org.opencontainers.image.description="City-wide 911 dispatch supervisor RL environment"

WORKDIR /app

# Install curl for the HEALTHCHECK
RUN apt-get update && apt-get install -y --no-install-recommends curl && rm -rf /var/lib/apt/lists/*

# Copy and install only the packages that exist on PyPI
# (openenv / openenv-core are not on PyPI — server runs fine without them)
COPY requirements.txt .
RUN pip install --no-cache-dir \
    pydantic>=2.7 \
    fastapi>=0.110 \
    "uvicorn[standard]>=0.29" \
    openai>=1.12 \
    httpx>=0.27 \
    matplotlib>=3.7 \
    numpy \
    groq \
    pyyaml>=6.0.1

# Copy source and data
COPY src/ /app/src/
COPY data/ /app/data/
COPY openenv.yaml /app/openenv.yaml
COPY live_dashboard.html /app/live_dashboard.html

# HuggingFace Spaces always routes to port 7860
EXPOSE 7860

HEALTHCHECK --interval=30s --timeout=10s --retries=3 \
  CMD curl -f http://localhost:7860/health || exit 1

CMD ["sh", "-c", "uvicorn src.server.app:app --host 0.0.0.0 --port ${PORT:-7860}"]