Update Dockerfile
Browse files- Dockerfile +14 -8
Dockerfile
CHANGED
|
@@ -1,20 +1,26 @@
|
|
| 1 |
-
|
|
|
|
| 2 |
|
| 3 |
-
|
|
|
|
| 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 |
-
|
| 13 |
|
| 14 |
-
|
|
|
|
| 15 |
|
| 16 |
-
|
|
|
|
| 17 |
|
|
|
|
| 18 |
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
|
| 19 |
|
| 20 |
-
|
|
|
|
|
|
| 1 |
+
# Use a slim Python image for a smaller container size
|
| 2 |
+
FROM python:3.13.5-slim
|
| 3 |
|
| 4 |
+
# Set the working directory inside the container
|
| 5 |
+
WORKDIR /app
|
| 6 |
|
| 7 |
+
# Install necessary system packages for file processing and git
|
| 8 |
RUN apt-get update && apt-get install -y \
|
| 9 |
build-essential \
|
| 10 |
curl \
|
| 11 |
git \
|
| 12 |
+
&& rm -rf /var/lib/apt/lists/* # Copy requirements.txt and install Python dependencies
|
|
|
|
| 13 |
COPY requirements.txt ./
|
| 14 |
+
RUN pip3 install -r requirements.txt
|
| 15 |
|
| 16 |
+
# Copy all your application files into the container
|
| 17 |
+
COPY . .
|
| 18 |
|
| 19 |
+
# Expose the Streamlit port
|
| 20 |
+
EXPOSE 8501
|
| 21 |
|
| 22 |
+
# Health check to ensure the application is running
|
| 23 |
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
|
| 24 |
|
| 25 |
+
# Command to run the Streamlit app
|
| 26 |
+
ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|