Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +19 -1
Dockerfile
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
|
|
|
|
|
| 1 |
FROM python:3.11-slim
|
| 2 |
|
|
|
|
|
|
|
| 3 |
WORKDIR /app
|
| 4 |
|
|
|
|
|
|
|
| 5 |
RUN apt-get update && apt-get install -y
|
| 6 |
build-essential
|
| 7 |
curl
|
|
@@ -15,15 +21,27 @@ libssl-dev
|
|
| 15 |
libstdc++6 &&
|
| 16 |
rm -rf /var/lib/apt/lists/*
|
| 17 |
|
|
|
|
|
|
|
| 18 |
COPY src/ ./src
|
| 19 |
COPY requirements.txt .
|
| 20 |
|
|
|
|
|
|
|
| 21 |
RUN pip install --upgrade pip
|
| 22 |
|
|
|
|
|
|
|
| 23 |
RUN pip install --ignore-installed -r requirements.txt
|
| 24 |
|
|
|
|
|
|
|
| 25 |
EXPOSE 8501
|
| 26 |
|
|
|
|
|
|
|
| 27 |
HEALTHCHECK CMD curl --fail [http://localhost:8501/_stcore/health](http://localhost:8501/_stcore/health) || exit 1
|
| 28 |
|
| 29 |
-
|
|
|
|
|
|
|
|
|
| 1 |
+
# Dockerfile optimized for Hugging Face Space
|
| 2 |
+
|
| 3 |
FROM python:3.11-slim
|
| 4 |
|
| 5 |
+
# Set working directory
|
| 6 |
+
|
| 7 |
WORKDIR /app
|
| 8 |
|
| 9 |
+
# Install system dependencies
|
| 10 |
+
|
| 11 |
RUN apt-get update && apt-get install -y
|
| 12 |
build-essential
|
| 13 |
curl
|
|
|
|
| 21 |
libstdc++6 &&
|
| 22 |
rm -rf /var/lib/apt/lists/*
|
| 23 |
|
| 24 |
+
# Copy source code and requirements
|
| 25 |
+
|
| 26 |
COPY src/ ./src
|
| 27 |
COPY requirements.txt .
|
| 28 |
|
| 29 |
+
# Upgrade pip
|
| 30 |
+
|
| 31 |
RUN pip install --upgrade pip
|
| 32 |
|
| 33 |
+
# Install dependencies while ignoring pre-installed system packages
|
| 34 |
+
|
| 35 |
RUN pip install --ignore-installed -r requirements.txt
|
| 36 |
|
| 37 |
+
# Expose Streamlit port
|
| 38 |
+
|
| 39 |
EXPOSE 8501
|
| 40 |
|
| 41 |
+
# Healthcheck
|
| 42 |
+
|
| 43 |
HEALTHCHECK CMD curl --fail [http://localhost:8501/_stcore/health](http://localhost:8501/_stcore/health) || exit 1
|
| 44 |
|
| 45 |
+
# Entry point
|
| 46 |
+
|
| 47 |
+
ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0", "--server.enableXsrfProtection=false"]
|