gary-boon Claude Opus 4.5 commited on
Commit
9377cd8
·
1 Parent(s): 3b5c3ac

Add GPU-enabled Dockerfile for Spark

Browse files

- Create docker/Dockerfile.spark using pytorch/pytorch CUDA base image
- Update compose.spark.yml to use Spark-specific Dockerfile
- Fixes CUDA not available issue on DGX Spark

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

docker/Dockerfile.spark ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # GPU-enabled Dockerfile for DGX Spark deployment
2
+ FROM pytorch/pytorch:2.1.0-cuda12.1-cudnn8-runtime
3
+
4
+ # Install system dependencies
5
+ RUN apt-get update && apt-get install -y \
6
+ curl \
7
+ build-essential \
8
+ git \
9
+ && rm -rf /var/lib/apt/lists/*
10
+
11
+ WORKDIR /app
12
+
13
+ # Copy and install Python requirements
14
+ COPY requirements.txt .
15
+ RUN pip install --no-cache-dir -r requirements.txt
16
+
17
+ # Copy backend code
18
+ COPY backend/ ./backend/
19
+ COPY app.py .
20
+
21
+ # Create runs directory
22
+ RUN mkdir -p /app/runs
23
+
24
+ # Health check (uses configurable port via environment)
25
+ HEALTHCHECK --interval=30s --timeout=3s --start-period=60s --retries=3 \
26
+ CMD curl -f http://localhost:${PORT:-8000}/health || exit 1
27
+
28
+ # Expose configurable port
29
+ EXPOSE ${PORT:-8000}
30
+
31
+ # Default command (overridden by compose.spark.yml)
32
+ CMD ["uvicorn", "backend.model_service:app", "--host", "0.0.0.0", "--port", "8000"]
docker/compose.spark.yml CHANGED
@@ -10,7 +10,7 @@ services:
10
  visualisable-ai-backend:
11
  build:
12
  context: ..
13
- dockerfile: Dockerfile
14
  ports:
15
  - "${PORT:-8000}:${PORT:-8000}"
16
  environment:
 
10
  visualisable-ai-backend:
11
  build:
12
  context: ..
13
+ dockerfile: docker/Dockerfile.spark
14
  ports:
15
  - "${PORT:-8000}:${PORT:-8000}"
16
  environment: