Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +18 -9
Dockerfile
CHANGED
@@ -1,18 +1,27 @@
|
|
1 |
-
|
|
|
2 |
|
|
|
3 |
WORKDIR /app
|
4 |
|
|
|
5 |
COPY requirements.txt .
|
6 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
7 |
|
8 |
-
|
9 |
-
|
10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
|
12 |
-
|
13 |
-
|
14 |
-
ENV TRANSFORMERS_CACHE=/app/cache
|
15 |
|
|
|
16 |
EXPOSE 7860
|
17 |
|
18 |
-
|
|
|
|
1 |
+
# Use an official Python runtime as the base image
|
2 |
+
FROM python:3.11-slim
|
3 |
|
4 |
+
# Set working directory inside the container
|
5 |
WORKDIR /app
|
6 |
|
7 |
+
# Copy requirements.txt to the working directory
|
8 |
COPY requirements.txt .
|
|
|
9 |
|
10 |
+
# Install system dependencies (for faiss, torch, etc.)
|
11 |
+
RUN apt-get update && apt-get install -y \
|
12 |
+
build-essential \
|
13 |
+
libatlas-base-dev \
|
14 |
+
gfortran \
|
15 |
+
&& rm -rf /var/lib/apt/lists/*
|
16 |
+
|
17 |
+
# Install Python dependencies
|
18 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
19 |
|
20 |
+
# Copy the entire application code and datasets to the container
|
21 |
+
COPY . .
|
|
|
22 |
|
23 |
+
# Expose the port your Flask app will run on (7860 as specified in app.py)
|
24 |
EXPOSE 7860
|
25 |
|
26 |
+
# Command to run the Flask app
|
27 |
+
CMD ["python", "app.py"]
|