Spaces:
Running
Running
Upload folder using huggingface_hub
Browse files- Dockerfile +15 -11
Dockerfile
CHANGED
|
@@ -1,18 +1,22 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
RUN apt-get update && apt-get install -y \
|
| 5 |
-
build-essential \
|
| 6 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 7 |
|
| 8 |
WORKDIR /app
|
| 9 |
|
|
|
|
|
|
|
|
|
|
| 10 |
COPY . .
|
| 11 |
|
| 12 |
-
#
|
| 13 |
-
RUN
|
| 14 |
-
RUN
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
-
EXPOSE 7860
|
| 17 |
|
| 18 |
-
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0", "--server.enableXsrfProtection=false"]
|
|
|
|
| 1 |
+
# Example in Dockerfile
|
| 2 |
+
FROM python:3.12-slim
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
|
| 4 |
WORKDIR /app
|
| 5 |
|
| 6 |
+
COPY requirements.txt .
|
| 7 |
+
RUN pip install -r requirements.txt
|
| 8 |
+
|
| 9 |
COPY . .
|
| 10 |
|
| 11 |
+
# Create a non-root user and give them ownership of /app
|
| 12 |
+
RUN adduser --disabled-password --gecos "" appuser
|
| 13 |
+
RUN chown -R appuser:appuser /app
|
| 14 |
+
|
| 15 |
+
# Switch to the non-root user
|
| 16 |
+
USER appuser
|
| 17 |
+
|
| 18 |
+
CMD ["streamlit", "run", "app.py"]
|
| 19 |
|
| 20 |
+
#EXPOSE 7860
|
| 21 |
|
| 22 |
+
#CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0", "--server.enableXsrfProtection=false"]
|