Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +15 -10
Dockerfile
CHANGED
|
@@ -1,25 +1,30 @@
|
|
| 1 |
-
# Use
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
# Set working directory
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
-
# Install system dependencies
|
| 8 |
RUN apt-get update && apt-get install -y \
|
|
|
|
| 9 |
libgl1 \
|
| 10 |
-
|
| 11 |
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
|
| 13 |
-
#
|
| 14 |
COPY requirements.txt .
|
| 15 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 16 |
|
| 17 |
-
# Copy app
|
| 18 |
-
COPY
|
| 19 |
-
COPY README.md .
|
| 20 |
|
| 21 |
-
#
|
| 22 |
EXPOSE 7860
|
| 23 |
|
| 24 |
-
#
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use official lightweight Python image
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
# Set working directory
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
+
# Install system dependencies (for scientific libs + image processing)
|
| 8 |
RUN apt-get update && apt-get install -y \
|
| 9 |
+
build-essential \
|
| 10 |
libgl1 \
|
| 11 |
+
libglib2.0-0 \
|
| 12 |
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
|
| 14 |
+
# Copy requirements and install
|
| 15 |
COPY requirements.txt .
|
| 16 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 17 |
|
| 18 |
+
# Copy app code
|
| 19 |
+
COPY . .
|
|
|
|
| 20 |
|
| 21 |
+
# Streamlit runs on port 7860 inside Hugging Face
|
| 22 |
EXPOSE 7860
|
| 23 |
|
| 24 |
+
# Set environment variables for Streamlit
|
| 25 |
+
ENV STREAMLIT_SERVER_HEADLESS=true \
|
| 26 |
+
STREAMLIT_SERVER_PORT=7860 \
|
| 27 |
+
STREAMLIT_SERVER_ENABLECORS=false
|
| 28 |
+
|
| 29 |
+
# Run the Streamlit app
|
| 30 |
+
CMD ["streamlit", "run", "app.py"]
|