Update Dockerfile
Browse files- Dockerfile +7 -5
Dockerfile
CHANGED
@@ -1,21 +1,23 @@
|
|
1 |
# Use a lightweight Python image
|
2 |
FROM python:3.10-slim
|
3 |
|
4 |
-
#
|
5 |
-
|
|
|
|
|
|
|
6 |
|
7 |
# Set the working directory inside the container
|
8 |
WORKDIR /app
|
9 |
|
10 |
# Copy and install dependencies
|
11 |
COPY requirements.txt .
|
12 |
-
RUN pip install --no-cache-dir
|
13 |
-
pip install --no-cache-dir -r requirements.txt
|
14 |
|
15 |
# Copy the entire project
|
16 |
COPY . .
|
17 |
|
18 |
-
# Expose the port
|
19 |
EXPOSE 7860
|
20 |
|
21 |
# Run FastAPI using Uvicorn
|
|
|
1 |
# Use a lightweight Python image
|
2 |
FROM python:3.10-slim
|
3 |
|
4 |
+
# Install necessary system dependencies
|
5 |
+
RUN apt-get update && apt-get install -y \
|
6 |
+
libgl1-mesa-glx \
|
7 |
+
libglib2.0-0 \
|
8 |
+
&& rm -rf /var/lib/apt/lists/* # Clean up package lists to reduce image size
|
9 |
|
10 |
# Set the working directory inside the container
|
11 |
WORKDIR /app
|
12 |
|
13 |
# Copy and install dependencies
|
14 |
COPY requirements.txt .
|
15 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
16 |
|
17 |
# Copy the entire project
|
18 |
COPY . .
|
19 |
|
20 |
+
# Expose the correct port for Hugging Face Spaces
|
21 |
EXPOSE 7860
|
22 |
|
23 |
# Run FastAPI using Uvicorn
|