Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +19 -16
Dockerfile
CHANGED
|
@@ -1,25 +1,28 @@
|
|
| 1 |
-
# Use a
|
| 2 |
-
FROM python:3.10-slim
|
| 3 |
|
| 4 |
-
# Set the working directory
|
| 5 |
-
WORKDIR /
|
| 6 |
|
| 7 |
-
#
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
| 12 |
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
|
| 14 |
-
#
|
| 15 |
-
COPY requirements.txt .
|
| 16 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 17 |
|
| 18 |
-
# Copy the application
|
| 19 |
-
COPY
|
| 20 |
|
| 21 |
-
# Expose
|
| 22 |
EXPOSE 5000
|
|
|
|
| 23 |
|
| 24 |
-
#
|
| 25 |
-
CMD ["
|
|
|
|
| 1 |
+
# Use a suitable base image. This one has Python and some common tools.
|
| 2 |
+
FROM python:3.10-slim-bullseye
|
| 3 |
|
| 4 |
+
# Set the working directory inside the container
|
| 5 |
+
WORKDIR /app
|
| 6 |
|
| 7 |
+
# Copy requirements file first to leverage Docker's caching
|
| 8 |
+
COPY requirements.txt .
|
| 9 |
+
|
| 10 |
+
# Install system dependencies for Ollama (if needed - check Ollama's instructions)
|
| 11 |
+
RUN apt-get update && \
|
| 12 |
+
apt-get install -y --no-install-recommends \
|
| 13 |
+
curl \
|
| 14 |
+
# Add any other system dependencies Ollama requires here
|
| 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 rest of your application code
|
| 21 |
+
COPY . .
|
| 22 |
|
| 23 |
+
# Expose the ports (for Flask and Gradio)
|
| 24 |
EXPOSE 5000
|
| 25 |
+
EXPOSE 7860
|
| 26 |
|
| 27 |
+
# Command to run when the container starts. Start Flask first, then Gradio.
|
| 28 |
+
CMD ["bash", "-c", "python api.py & python app.py"]
|