jaimegalanmartinez commited on
Commit
f08d2de
Β·
1 Parent(s): 4b23a38

Added initial dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +35 -0
Dockerfile ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.12-slim
2
+
3
+ # Set working directory
4
+ WORKDIR /app
5
+
6
+ # Install minimal build tools
7
+ RUN apt-get update && apt-get install -y \
8
+ build-essential \
9
+ git \
10
+ wget \
11
+ ca-certificates \
12
+ && update-ca-certificates \
13
+ && rm -rf /var/lib/apt/lists/*
14
+
15
+ # Upgrade pip and install prebuilt PyTorch wheel first
16
+ RUN pip install --upgrade pip
17
+
18
+ # Install PyTorch CPU first (prebuilt wheel speeds up sentence-transformers)
19
+ RUN pip install torch --index-url https://download.pytorch.org/whl/cpu
20
+
21
+ # Copy pyproject.toml and install other dependencies
22
+ COPY pyproject.toml .
23
+ RUN pip install --no-cache-dir --prefer-binary .
24
+
25
+ # Copy files needed
26
+ COPY app.css app.py rag_filters.py rag_pipeline.py ./
27
+ COPY data ./data
28
+
29
+ # Expose Gradio port
30
+ EXPOSE 7860
31
+
32
+ ENV PYTHONUNBUFFERED=1
33
+
34
+ # Run app
35
+ CMD ["python3", "-u", "app.py"]