Update Dockerfile
Browse files- Dockerfile +8 -8
Dockerfile
CHANGED
|
@@ -1,25 +1,25 @@
|
|
| 1 |
# Use official Python base image
|
| 2 |
FROM python:3.9
|
| 3 |
|
| 4 |
-
# Add a non-root user required by
|
| 5 |
RUN useradd -m -u 1000 user
|
| 6 |
|
| 7 |
-
# Set working directory
|
| 8 |
WORKDIR /app
|
| 9 |
|
| 10 |
-
# Copy requirements
|
| 11 |
COPY requirements.txt ./requirements.txt
|
| 12 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 13 |
|
| 14 |
-
# Copy your
|
| 15 |
COPY . /app
|
| 16 |
|
| 17 |
-
# Switch to
|
| 18 |
USER user
|
| 19 |
|
| 20 |
-
# Set
|
| 21 |
ENV HOME=/home/user \
|
| 22 |
-
PATH=/home/user/.local/bin:$PATH
|
|
|
|
| 23 |
|
| 24 |
-
# Run JupyterLab
|
| 25 |
CMD ["jupyter", "lab", "--ip=0.0.0.0", "--port=7860", "--no-browser", "--allow-root"]
|
|
|
|
| 1 |
# Use official Python base image
|
| 2 |
FROM python:3.9
|
| 3 |
|
| 4 |
+
# Add a non-root user (required by Hugging Face Spaces)
|
| 5 |
RUN useradd -m -u 1000 user
|
| 6 |
|
|
|
|
| 7 |
WORKDIR /app
|
| 8 |
|
| 9 |
+
# Copy requirements and install dependencies
|
| 10 |
COPY requirements.txt ./requirements.txt
|
| 11 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 12 |
|
| 13 |
+
# Copy your notebooks and other files
|
| 14 |
COPY . /app
|
| 15 |
|
| 16 |
+
# Switch to non-root user
|
| 17 |
USER user
|
| 18 |
|
| 19 |
+
# Set environment variables including fixed JUPYTER_TOKEN
|
| 20 |
ENV HOME=/home/user \
|
| 21 |
+
PATH=/home/user/.local/bin:$PATH \
|
| 22 |
+
JUPYTER_TOKEN=curseofwitcher
|
| 23 |
|
| 24 |
+
# Run JupyterLab on port 7860 with no browser and allow root
|
| 25 |
CMD ["jupyter", "lab", "--ip=0.0.0.0", "--port=7860", "--no-browser", "--allow-root"]
|