Rafs-an09002 commited on
Commit
34aeebd
·
verified ·
1 Parent(s): d6ea406

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +46 -0
Dockerfile ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Nexus-Core Inference - Lightweight & Fast
2
+ # 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 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
+
46
+ CMD ["python", "app.py"]