Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +15 -8
Dockerfile
CHANGED
|
@@ -4,20 +4,27 @@ FROM python:3.9-slim
|
|
| 4 |
# Set working directory inside container
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
-
# Install system dependencies (
|
| 8 |
-
RUN apt-get update && apt-get install -y \
|
| 9 |
build-essential \
|
| 10 |
-
curl \
|
| 11 |
-
software-properties-common \
|
| 12 |
git \
|
|
|
|
| 13 |
&& rm -rf /var/lib/apt/lists/*
|
| 14 |
|
| 15 |
-
# Copy requirements.txt
|
| 16 |
COPY requirements.txt ./
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 18 |
|
| 19 |
-
# Copy
|
| 20 |
COPY . .
|
| 21 |
|
| 22 |
-
#
|
| 23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
# Set working directory inside container
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
+
# Install system dependencies (build essentials, git, curl, etc.)
|
| 8 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 9 |
build-essential \
|
|
|
|
|
|
|
| 10 |
git \
|
| 11 |
+
curl \
|
| 12 |
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
|
| 14 |
+
# Copy only requirements.txt first for better caching
|
| 15 |
COPY requirements.txt ./
|
| 16 |
+
|
| 17 |
+
# Upgrade pip to latest to avoid some install issues
|
| 18 |
+
RUN pip install --upgrade pip
|
| 19 |
+
|
| 20 |
+
# Install Python dependencies
|
| 21 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 22 |
|
| 23 |
+
# Copy the rest of your app files after dependencies installed
|
| 24 |
COPY . .
|
| 25 |
|
| 26 |
+
# Expose the port (optional but good practice)
|
| 27 |
+
EXPOSE 7860
|
| 28 |
+
|
| 29 |
+
# Run Streamlit app on 0.0.0.0 to be accessible externally, port 7860
|
| 30 |
+
CMD ["streamlit", "run", "streamlit_app.py", "--server.port=7860", "--server.address=0.0.0.0", "--server.headless=true"]
|