-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.serve
More file actions
35 lines (25 loc) · 1.1 KB
/
Dockerfile.serve
File metadata and controls
35 lines (25 loc) · 1.1 KB
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
# RADAR serving image — CPU-capable, CUDA-ready when gpus=all is set.
FROM python:3.11-slim
LABEL org.opencontainers.image.title="anima-radar-serve"
LABEL org.opencontainers.image.source="https://github.com/RobotFlow-Labs/project_radar"
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PIP_NO_CACHE_DIR=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1
WORKDIR /app
RUN apt-get update \
&& apt-get install -y --no-install-recommends build-essential curl \
&& rm -rf /var/lib/apt/lists/*
COPY pyproject.toml README.md ./
COPY src ./src
COPY configs ./configs
RUN pip install --upgrade pip \
&& pip install "torch>=2.0" --index-url https://download.pytorch.org/whl/cpu \
&& pip install numpy pydantic pydantic-settings safetensors onnx fastapi "uvicorn[standard]" \
&& pip install -e .
ENV RADAR_CONFIG=/app/configs/default.toml
ENV RADAR_CHECKPOINT=/models/radar/best.pth
EXPOSE 8000
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 \
CMD curl -fsS http://localhost:8000/health || exit 1
CMD ["uvicorn", "anima_radar.serve:create_app", "--factory", "--host", "0.0.0.0", "--port", "8000"]