Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse filesTo avoid dependency issues.
- Dockerfile +12 -7
Dockerfile
CHANGED
|
@@ -1,20 +1,25 @@
|
|
| 1 |
-
|
|
|
|
| 2 |
|
|
|
|
| 3 |
WORKDIR /app
|
| 4 |
|
|
|
|
| 5 |
RUN apt-get update && apt-get install -y \
|
| 6 |
build-essential \
|
| 7 |
curl \
|
| 8 |
git \
|
| 9 |
&& rm -rf /var/lib/apt/lists/*
|
| 10 |
|
|
|
|
| 11 |
COPY requirements.txt ./
|
| 12 |
-
COPY src/ ./src/
|
| 13 |
|
| 14 |
-
|
|
|
|
| 15 |
|
| 16 |
-
|
|
|
|
|
|
|
| 17 |
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|
|
|
|
| 1 |
+
# Use a stable, widely supported Python version (3.11 is highly recommended)
|
| 2 |
+
FROM python:3.11
|
| 3 |
|
| 4 |
+
# Set the working directory
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
+
# Install necessary system packages for building Python packages (like pandas)
|
| 8 |
RUN apt-get update && apt-get install -y \
|
| 9 |
build-essential \
|
| 10 |
curl \
|
| 11 |
git \
|
| 12 |
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
|
| 14 |
+
# Copy the dependency file
|
| 15 |
COPY requirements.txt ./
|
|
|
|
| 16 |
|
| 17 |
+
# Install Python dependencies
|
| 18 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 19 |
|
| 20 |
+
# Copy the application code (assuming your app is in the root)
|
| 21 |
+
# If your app is in 'src/', change this to COPY src/ ./src/
|
| 22 |
+
COPY streamlit_app.py ./
|
| 23 |
|
| 24 |
+
# Define the command to run the Streamlit application
|
| 25 |
+
CMD ["streamlit", "run", "streamlit_app.py"]
|
|
|