Rafs-an09002 commited on
Commit
56b3ca2
·
verified ·
1 Parent(s): 8d94947

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +42 -1
Dockerfile CHANGED
@@ -1,11 +1,52 @@
 
 
 
1
  FROM python:3.10-slim
 
2
  WORKDIR /app
3
- RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
 
 
 
 
 
 
 
4
  COPY requirements.txt .
5
  RUN pip install --no-cache-dir -r requirements.txt
 
 
 
 
 
6
  COPY app.py .
7
  COPY engine/ ./engine/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  EXPOSE 7860
 
 
9
  ENV PYTHONUNBUFFERED=1
10
  ENV OMP_NUM_THREADS=2
 
 
 
 
 
 
 
 
11
  CMD ["python", "app.py"]
 
1
+ # Nexus-Core Inference Engine
2
+ # Optimized for HF Spaces CPU (2 vCPU, 16GB RAM)
3
+
4
  FROM python:3.10-slim
5
+
6
  WORKDIR /app
7
+
8
+ # System dependencies
9
+ RUN apt-get update && apt-get install -y \
10
+ build-essential \
11
+ curl \
12
+ && rm -rf /var/lib/apt/lists/*
13
+
14
+ # Python dependencies
15
  COPY requirements.txt .
16
  RUN pip install --no-cache-dir -r requirements.txt
17
+
18
+ # Create directory structure
19
+ RUN mkdir -p /app/models /app/engine /app/utils
20
+
21
+ # Copy application code
22
  COPY app.py .
23
  COPY engine/ ./engine/
24
+ COPY utils/ ./utils/
25
+
26
+ # Download Nexus-Core model from HuggingFace
27
+ RUN python -c "from huggingface_hub import hf_hub_download; \
28
+ hf_hub_download( \
29
+ repo_id='GambitFlow/Nexus-Core', \
30
+ filename='nexus-core.onnx', \
31
+ local_dir='/app/models', \
32
+ local_dir_use_symlinks=False \
33
+ )"
34
+
35
+ # Verify model
36
+ RUN ls -lh /app/models/nexus-core.onnx
37
+
38
+ # Expose port
39
  EXPOSE 7860
40
+
41
+ # CPU optimization
42
  ENV PYTHONUNBUFFERED=1
43
  ENV OMP_NUM_THREADS=2
44
+ ENV MKL_NUM_THREADS=2
45
+ ENV OPENBLAS_NUM_THREADS=2
46
+
47
+ # Health check
48
+ HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
49
+ CMD curl -f http://localhost:7860/health || exit 1
50
+
51
+ # Run
52
  CMD ["python", "app.py"]