leeaandrob commited on
Commit
31aaa04
·
1 Parent(s): 3a00d4d

Add dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +32 -0
Dockerfile ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.9-slim
2
+
3
+ WORKDIR /app
4
+
5
+ # Install system dependencies
6
+ RUN apt-get update && apt-get install -y --no-install-recommends \
7
+ build-essential \
8
+ && rm -rf /var/lib/apt/lists/*
9
+
10
+ # Install Python dependencies
11
+ RUN pip install --no-cache-dir \
12
+ fastapi>=0.95.0 \
13
+ uvicorn>=0.21.0 \
14
+ pydantic>=1.10.7 \
15
+ onnxruntime>=1.14.0 \
16
+ sentence-transformers>=2.2.0 \
17
+ numpy>=1.20.0 \
18
+ pyyaml>=6.0
19
+
20
+ # Copy application code
21
+ COPY app.py .
22
+ COPY models/ models/
23
+
24
+ # Expose port
25
+ EXPOSE 7860
26
+
27
+ # Set environment variables
28
+ ENV PYTHONPATH=/app
29
+ ENV MODELS_DIR=/app/models
30
+
31
+ # Run the API server
32
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]