Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +11 -35
Dockerfile
CHANGED
|
@@ -1,55 +1,31 @@
|
|
| 1 |
-
# Use Python base image
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
-
# Set working directory
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
# Install system dependencies including FFmpeg
|
| 8 |
-
RUN apt-get update && apt-get install -y
|
| 9 |
-
|
| 10 |
-
libsm6 \
|
| 11 |
-
libxext6 \
|
| 12 |
-
libxrender1 \
|
| 13 |
-
libgl1 \
|
| 14 |
-
libglib2.0-0 \
|
| 15 |
-
git \
|
| 16 |
curl \
|
| 17 |
-
|
|
|
|
| 18 |
&& rm -rf /var/lib/apt/lists/*
|
| 19 |
|
| 20 |
-
#
|
| 21 |
-
|
| 22 |
-
USER user
|
| 23 |
-
ENV HOME=/home/user \
|
| 24 |
-
PATH=/home/user/.local/bin:$PATH
|
| 25 |
|
| 26 |
-
|
| 27 |
-
WORKDIR $HOME/app
|
| 28 |
-
|
| 29 |
-
# Copy requirements first (for caching)
|
| 30 |
-
COPY --chown=user:user requirements.txt .
|
| 31 |
-
|
| 32 |
-
# Install Python dependencies
|
| 33 |
-
RUN pip install --no-cache-dir --upgrade pip && \
|
| 34 |
-
pip install --no-cache-dir -r requirements.txt
|
| 35 |
|
| 36 |
# Copy application files
|
| 37 |
-
COPY
|
| 38 |
|
| 39 |
# Create temp directory
|
| 40 |
RUN mkdir -p temp
|
| 41 |
|
| 42 |
-
# Expose
|
| 43 |
EXPOSE 7860
|
| 44 |
|
| 45 |
# Health check
|
| 46 |
-
HEALTHCHECK CMD curl --fail http://localhost:7860/_stcore/health
|
| 47 |
-
|
| 48 |
-
# Set environment variables for Streamlit
|
| 49 |
-
ENV STREAMLIT_SERVER_PORT=7860 \
|
| 50 |
-
STREAMLIT_SERVER_ADDRESS=0.0.0.0 \
|
| 51 |
-
STREAMLIT_SERVER_HEADLESS=true \
|
| 52 |
-
STREAMLIT_BROWSER_GATHER_USAGE_STATS=false
|
| 53 |
|
| 54 |
# Run the application
|
| 55 |
-
|
|
|
|
|
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
|
|
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
# Install system dependencies including FFmpeg
|
| 6 |
+
RUN apt-get update && apt-get install -y \
|
| 7 |
+
build-essential \
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
curl \
|
| 9 |
+
git \
|
| 10 |
+
ffmpeg \
|
| 11 |
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
|
| 13 |
+
# Copy and install requirements
|
| 14 |
+
COPY requirements.txt ./
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
+
RUN pip3 install --no-cache-dir -r requirements.txt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
# Copy application files
|
| 19 |
+
COPY . .
|
| 20 |
|
| 21 |
# Create temp directory
|
| 22 |
RUN mkdir -p temp
|
| 23 |
|
| 24 |
+
# Expose port for HF Spaces
|
| 25 |
EXPOSE 7860
|
| 26 |
|
| 27 |
# Health check
|
| 28 |
+
HEALTHCHECK CMD curl --fail http://localhost:7860/_stcore/health
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
# Run the application
|
| 31 |
+
ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]
|