File size: 685 Bytes
c8e9d9f
 
 
b07fd41
c8e9d9f
 
 
 
b07fd41
c8e9d9f
 
 
b07fd41
c8e9d9f
 
b07fd41
c8e9d9f
 
b07fd41
c8e9d9f
b07fd41
 
c8e9d9f
b07fd41
c8e9d9f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Use official Python base image
FROM python:3.9

# Add a non-root user (required by Hugging Face Spaces)
RUN useradd -m -u 1000 user

WORKDIR /app

# Copy requirements and install dependencies
COPY requirements.txt ./requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt

# Copy your notebooks and other files
COPY . /app

# Switch to non-root user
USER user

# Set environment variables including fixed JUPYTER_TOKEN
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH \
    JUPYTER_TOKEN=curseofwitcher

# Run JupyterLab on port 7860 with no browser and allow root
CMD ["jupyter", "lab", "--ip=0.0.0.0", "--port=7860", "--no-browser", "--allow-root"]