Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +7 -16
Dockerfile
CHANGED
|
@@ -1,29 +1,20 @@
|
|
|
|
|
| 1 |
FROM python:3.9-slim
|
| 2 |
|
|
|
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
#
|
| 6 |
-
RUN apt-get update && apt-get install -y \
|
| 7 |
-
build-essential \
|
| 8 |
-
curl \
|
| 9 |
-
software-properties-common \
|
| 10 |
-
git \
|
| 11 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
-
|
| 13 |
-
# Copy requirements first for better caching
|
| 14 |
COPY requirements.txt .
|
| 15 |
|
| 16 |
-
# Install
|
| 17 |
-
RUN
|
| 18 |
|
| 19 |
# Copy application files
|
| 20 |
COPY . .
|
| 21 |
|
| 22 |
# Expose port
|
| 23 |
-
EXPOSE
|
| 24 |
-
|
| 25 |
-
# Health check
|
| 26 |
-
HEALTHCHECK CMD curl --fail http://localhost:7860/_stcore/health
|
| 27 |
|
| 28 |
# Run the application
|
| 29 |
-
|
|
|
|
| 1 |
+
# Start from official Python image
|
| 2 |
FROM python:3.9-slim
|
| 3 |
|
| 4 |
+
# Set working directory
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
+
# Copy requirements first for caching
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
COPY requirements.txt .
|
| 9 |
|
| 10 |
+
# Install dependencies
|
| 11 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 12 |
|
| 13 |
# Copy application files
|
| 14 |
COPY . .
|
| 15 |
|
| 16 |
# Expose port
|
| 17 |
+
EXPOSE 8501
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
# Run the application
|
| 20 |
+
CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|