-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.model
More file actions
25 lines (17 loc) · 791 Bytes
/
Dockerfile.model
File metadata and controls
25 lines (17 loc) · 791 Bytes
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
FROM python:3.11-slim
WORKDIR /app
# Install base server dependencies
COPY server/requirements.txt /app/server-requirements.txt
RUN pip install --no-cache-dir -r /app/server-requirements.txt
# Install model-specific dependencies (passed via build arg)
ARG MODEL_NAME
COPY models/${MODEL_NAME}/requirements.txt /app/model-requirements.txt
RUN pip install --no-cache-dir -r /app/model-requirements.txt
# Copy the generic model server
COPY server/serve.py /app/serve.py
# Copy the model handler and any model files
COPY models/${MODEL_NAME}/ /app/model/
EXPOSE 8000
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"
CMD ["uvicorn", "serve:app", "--host", "0.0.0.0", "--port", "8000"]