Update Dockerfile
Browse files- Dockerfile +18 -3
Dockerfile
CHANGED
|
@@ -1,5 +1,20 @@
|
|
| 1 |
FROM python:3.10
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
RUN
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
CMD ["streamlit", "run", "app.py", "--server.port", "7860", "--server.address", "0.0.0.0"]
|
|
|
|
| 1 |
FROM python:3.10
|
| 2 |
+
|
| 3 |
+
# 1. Create the specific user required by Hugging Face Spaces
|
| 4 |
+
RUN useradd -m -u 1000 user
|
| 5 |
+
USER user
|
| 6 |
+
ENV PATH="/home/user/.local/bin:$PATH"
|
| 7 |
+
ENV HOME="/home/user"
|
| 8 |
+
|
| 9 |
+
# 2. Set the working directory to that user's safe space
|
| 10 |
+
WORKDIR $HOME/app
|
| 11 |
+
|
| 12 |
+
# 3. Copy requirements and install them
|
| 13 |
+
COPY --chown=user:user requirements.txt .
|
| 14 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 15 |
+
|
| 16 |
+
# 4. Copy your app.py and images into the safe space
|
| 17 |
+
COPY --chown=user:user . .
|
| 18 |
+
|
| 19 |
+
# 5. Launch Streamlit
|
| 20 |
CMD ["streamlit", "run", "app.py", "--server.port", "7860", "--server.address", "0.0.0.0"]
|