File size: 640 Bytes
dc3d345
 
 
 
 
 
 
 
 
 
 
 
382741d
 
 
 
dc3d345
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
FROM python:3.11-slim

WORKDIR /app

# Install dependencies first for better layer caching.
COPY requirements.txt pyproject.toml ./
RUN pip install --no-cache-dir -r requirements.txt

# Copy source and install the package (makes `nephroscreen` importable).
COPY . .
RUN pip install --no-cache-dir -e .

# Train the model at build time (fast + deterministic: pinned deps, fixed seed).
# Keeps binaries out of git and guarantees the served model matches the code.
RUN python -m nephroscreen.train

EXPOSE 8000
# Render/Cloud Run set $PORT; default to 8000 locally.
CMD ["sh", "-c", "uvicorn api.main:app --host 0.0.0.0 --port ${PORT:-8000}"]