Spaces:
Runtime error
Runtime error
Upload streamlit_app.py with huggingface_hub
Browse files- streamlit_app.py +24 -9
streamlit_app.py
CHANGED
|
@@ -1,14 +1,29 @@
|
|
| 1 |
-
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
|
| 11 |
|
| 12 |
-
|
|
|
|
|
|
|
| 13 |
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.11-slim
|
| 2 |
|
| 3 |
+
# Set up user with proper permissions
|
| 4 |
+
RUN useradd -m -u 1000 streamlit
|
| 5 |
+
WORKDIR /app
|
| 6 |
+
USER streamlit
|
| 7 |
|
| 8 |
+
# Install system dependencies
|
| 9 |
+
RUN apt-get update && apt-get install -y \
|
| 10 |
+
curl \
|
| 11 |
+
git \
|
| 12 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
|
| 14 |
+
# Install Node.js and npm for potential frontend needs
|
| 15 |
+
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - &&\
|
| 16 |
+
apt-get install -y nodejs
|
| 17 |
|
| 18 |
+
# Install Python dependencies
|
| 19 |
+
COPY requirements.txt .
|
| 20 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 21 |
|
| 22 |
+
# Copy the application files
|
| 23 |
+
COPY . .
|
| 24 |
+
|
| 25 |
+
# Expose the Streamlit port
|
| 26 |
+
EXPOSE 7860
|
| 27 |
+
|
| 28 |
+
# Command to run the Streamlit app
|
| 29 |
+
CMD ["streamlit", "run", "streamlit_app.py", "--server.port=7860", "--server.address=0.0.0.0"]
|