Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +18 -4
Dockerfile
CHANGED
|
@@ -1,5 +1,13 @@
|
|
| 1 |
-
# Use Python
|
| 2 |
-
FROM python:3.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
|
| 4 |
# Add a non-root user
|
| 5 |
RUN useradd -m -u 1000 user
|
|
@@ -13,8 +21,14 @@ WORKDIR /app
|
|
| 13 |
COPY --chown=user requirements.txt ./requirements.txt
|
| 14 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 15 |
|
| 16 |
-
#
|
|
|
|
|
|
|
|
|
|
| 17 |
COPY --chown=user . /app
|
| 18 |
|
| 19 |
-
#
|
|
|
|
|
|
|
|
|
|
| 20 |
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]
|
|
|
|
| 1 |
+
# ✅ Use Python 3.11 (ensures compatibility with pysqlite3)
|
| 2 |
+
FROM python:3.11-slim
|
| 3 |
+
|
| 4 |
+
# Install system dependencies
|
| 5 |
+
RUN apt-get update && apt-get install -y \
|
| 6 |
+
build-essential \
|
| 7 |
+
curl \
|
| 8 |
+
git \
|
| 9 |
+
libsqlite3-dev \
|
| 10 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
|
| 12 |
# Add a non-root user
|
| 13 |
RUN useradd -m -u 1000 user
|
|
|
|
| 21 |
COPY --chown=user requirements.txt ./requirements.txt
|
| 22 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 23 |
|
| 24 |
+
# 👉 Fix sqlite issue by installing pysqlite3-binary
|
| 25 |
+
RUN pip install pysqlite3-binary==0.5.2
|
| 26 |
+
|
| 27 |
+
# Copy the entire app
|
| 28 |
COPY --chown=user . /app
|
| 29 |
|
| 30 |
+
# Expose the port (required by HF)
|
| 31 |
+
EXPOSE 7860
|
| 32 |
+
|
| 33 |
+
# Run the Streamlit app
|
| 34 |
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]
|