Rafs-an09002 commited on
Commit
672d6de
·
verified ·
1 Parent(s): a9593bb

Update Dockerfile

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