| |
| |
|
|
| |
| FROM node:20-bookworm-slim AS dashboard-build |
| WORKDIR /app/dashboard |
| COPY dashboard/package.json dashboard/package-lock.json* ./ |
| RUN npm ci --no-audit --no-fund || npm install --no-audit --no-fund |
| COPY dashboard/ ./ |
| |
| ENV VITE_API_BASE="" |
| RUN npm run build |
|
|
| |
| FROM python:3.11-slim-bookworm AS runtime |
| ENV PYTHONDONTWRITEBYTECODE=1 \ |
| PYTHONUNBUFFERED=1 \ |
| PIP_NO_CACHE_DIR=1 |
|
|
| |
| RUN apt-get update && apt-get install -y --no-install-recommends \ |
| libgomp1 \ |
| curl \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| WORKDIR /app |
|
|
| |
| COPY pyproject.toml ./ |
| RUN pip install --no-cache-dir --index-url https://download.pytorch.org/whl/cpu torch==2.2.2 \ |
| && pip install --no-cache-dir \ |
| "numpy>=1.26,<2" "scipy>=1.12,<1.14" "iapws>=1.5.3" \ |
| "matplotlib>=3.8" "pyyaml>=6.0" "python-dotenv>=1.0" \ |
| "claude-agent-sdk>=0.1.0" "anthropic>=0.40.0" \ |
| "fastapi>=0.110" "uvicorn[standard]>=0.29" "sse-starlette>=2.0" |
|
|
| |
| COPY agent/ ./agent/ |
| COPY solver/ ./solver/ |
| COPY surrogate/ ./surrogate/ |
| COPY tools/ ./tools/ |
| COPY demo/ ./demo/ |
| COPY app/ ./app/ |
|
|
| |
| |
| |
| |
| RUN f=surrogate/weights/geoforce_cnn_v1.1.pt && \ |
| if head -c 64 "$f" | grep -q '^version https://git-lfs'; then \ |
| echo "Replacing LFS pointer with real weights…" && \ |
| curl -fsSL -o "$f" \ |
| "https://huggingface.co/spaces/robiriu/geoforce/resolve/main/surrogate/weights/geoforce_cnn_v1.1.pt" && \ |
| ls -la "$f"; \ |
| fi |
|
|
| |
| COPY --from=dashboard-build /app/dashboard/dist ./dashboard/dist |
|
|
| EXPOSE 8765 |
| HEALTHCHECK --interval=30s --timeout=3s --start-period=10s \ |
| CMD curl -fsS http://localhost:8765/health || exit 1 |
|
|
| CMD ["uvicorn", "agent.api:app", "--host", "0.0.0.0", "--port", "8765"] |
|
|