Rafs-an09002 commited on
Commit
3595fe3
·
verified ·
1 Parent(s): 8d1f456

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -8
Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- # Nexus-Core Inference - Lightweight & Fast
2
  # HF Spaces CPU (2 vCPU, 16GB RAM)
3
 
4
  FROM python:3.10-slim
@@ -15,31 +15,41 @@ RUN apt-get update && apt-get install -y \
15
  COPY requirements.txt .
16
  RUN pip install --no-cache-dir -r requirements.txt
17
 
18
- # Create folders
19
  RUN mkdir -p /app/models /app/engine
20
 
21
- # Copy code
22
  COPY app.py .
23
- COPY engine/ ./engine/
24
 
25
- # Download Nexus-Core model
 
 
 
 
26
  RUN python -c "from huggingface_hub import hf_hub_download; \
 
27
  hf_hub_download( \
28
  repo_id='GambitFlow/Nexus-Core', \
29
  filename='nexus_core.onnx', \
30
  local_dir='/app/models', \
31
  local_dir_use_symlinks=False \
32
- )"
 
33
 
34
- # Verify
35
- RUN ls -lh /app/models/nexus_core.onnx
 
 
 
36
 
37
  EXPOSE 7860
38
 
 
39
  ENV PYTHONUNBUFFERED=1
40
  ENV OMP_NUM_THREADS=2
41
  ENV MKL_NUM_THREADS=2
42
 
 
43
  HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
44
  CMD curl -f http://localhost:7860/health || exit 1
45
 
 
1
+ # Nexus-Core Inference - Fixed Build
2
  # HF Spaces CPU (2 vCPU, 16GB RAM)
3
 
4
  FROM python:3.10-slim
 
15
  COPY requirements.txt .
16
  RUN pip install --no-cache-dir -r requirements.txt
17
 
18
+ # Create ALL necessary folders BEFORE copying files
19
  RUN mkdir -p /app/models /app/engine
20
 
21
+ # Copy application files
22
  COPY app.py .
 
23
 
24
+ # Copy engine folder (if it exists)
25
+ COPY engine/__init__.py ./engine/__init__.py
26
+ COPY engine/search.py ./engine/search.py
27
+
28
+ # Download Nexus-Core model from HuggingFace
29
  RUN python -c "from huggingface_hub import hf_hub_download; \
30
+ print('Downloading Nexus-Core model...'); \
31
  hf_hub_download( \
32
  repo_id='GambitFlow/Nexus-Core', \
33
  filename='nexus_core.onnx', \
34
  local_dir='/app/models', \
35
  local_dir_use_symlinks=False \
36
+ ); \
37
+ print('Download complete!')"
38
 
39
+ # Verify model file exists
40
+ RUN ls -lh /app/models/ && \
41
+ test -f /app/models/nexus_core.onnx && \
42
+ echo "✅ Model file verified" || \
43
+ (echo "❌ Model file missing!" && exit 1)
44
 
45
  EXPOSE 7860
46
 
47
+ # Environment variables
48
  ENV PYTHONUNBUFFERED=1
49
  ENV OMP_NUM_THREADS=2
50
  ENV MKL_NUM_THREADS=2
51
 
52
+ # Health check
53
  HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
54
  CMD curl -f http://localhost:7860/health || exit 1
55