Update Dockerfile
Browse files- Dockerfile +13 -15
Dockerfile
CHANGED
|
@@ -1,21 +1,19 @@
|
|
| 1 |
-
|
|
|
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
COPY requirements.txt .
|
| 6 |
-
|
| 7 |
-
# Set environment variable to disable build isolation
|
| 8 |
-
ENV PIP_NO_BUILD_ISOLATION=1
|
| 9 |
|
| 10 |
-
#
|
| 11 |
-
|
|
|
|
| 12 |
|
| 13 |
-
#
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
# Now install all other requirements, including flash-attn
|
| 17 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
| 18 |
|
| 19 |
-
|
|
|
|
| 20 |
|
|
|
|
| 21 |
CMD ["python", "app.py"]
|
|
|
|
| 1 |
+
# Use an official Python runtime as the base image
|
| 2 |
+
FROM python:3.10
|
| 3 |
|
| 4 |
+
# Install torch first to make it available for other packages' build processes
|
| 5 |
+
RUN pip install torch
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
+
# Copy requirements.txt and install remaining dependencies
|
| 8 |
+
COPY requirements.txt /tmp/requirements.txt
|
| 9 |
+
RUN pip install --no-cache-dir -r /tmp/requirements.txt
|
| 10 |
|
| 11 |
+
# Copy your application code to the container
|
| 12 |
+
COPY . /app
|
| 13 |
+
WORKDIR /app
|
|
|
|
|
|
|
| 14 |
|
| 15 |
+
# Expose the port (default for Gradio/Hugging Face Spaces is 7860)
|
| 16 |
+
EXPOSE 7860
|
| 17 |
|
| 18 |
+
# Command to run your application (adjust 'app.py' to your main script)
|
| 19 |
CMD ["python", "app.py"]
|