Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files- Dockerfile +11 -8
Dockerfile
CHANGED
|
@@ -1,18 +1,21 @@
|
|
| 1 |
-
|
| 2 |
FROM python:3.11-slim
|
| 3 |
|
| 4 |
-
#
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
-
#
|
| 8 |
-
COPY . .
|
|
|
|
| 9 |
|
| 10 |
-
#
|
| 11 |
-
|
| 12 |
|
| 13 |
EXPOSE 8501
|
| 14 |
|
| 15 |
-
# Define the command to run the Streamlit app on port 8501 and make it accessible externally
|
| 16 |
ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0", "--server.enableXsrfProtection=false"]
|
| 17 |
|
| 18 |
# NOTE: Disable XSRF protection for easier external access in order to make batch predictions
|
|
|
|
| 1 |
+
|
| 2 |
FROM python:3.11-slim
|
| 3 |
|
| 4 |
+
# Create non-root user that matches Spaces runtime (uid 1000), set HOME
|
| 5 |
+
RUN useradd -m -u 1000 user
|
| 6 |
+
USER user
|
| 7 |
+
ENV HOME=/home/user PATH=/home/user/.local/bin:$PATH
|
| 8 |
+
WORKDIR $HOME/app
|
| 9 |
|
| 10 |
+
# Install dependencies as the user
|
| 11 |
+
COPY --chown=user requirements.txt .
|
| 12 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 13 |
|
| 14 |
+
# Copy app code with correct ownership
|
| 15 |
+
COPY --chown=user . .
|
| 16 |
|
| 17 |
EXPOSE 8501
|
| 18 |
|
|
|
|
| 19 |
ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0", "--server.enableXsrfProtection=false"]
|
| 20 |
|
| 21 |
# NOTE: Disable XSRF protection for easier external access in order to make batch predictions
|