nakas commited on
Commit
3a92c3c
·
verified ·
1 Parent(s): 88c3e8d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -33
Dockerfile CHANGED
@@ -1,38 +1,17 @@
1
- FROM python:3.9-slim
2
 
3
- WORKDIR /app
 
4
 
5
- # Install dependencies
6
- RUN pip install --no-cache-dir \
7
- jupyter \
8
- notebook \
9
- ipywidgets \
10
- numpy \
11
- pandas \
12
- matplotlib \
13
- seaborn \
14
- scikit-learn \
15
- transformers \
16
- torch \
17
- gradio
18
 
19
- # Create a non-root user to run Jupyter
20
- RUN useradd -m jupyter
21
- RUN mkdir -p /app/notebooks && chown -R jupyter:jupyter /app
22
 
23
- # Copy files
24
- COPY --chown=jupyter:jupyter welcome.ipynb /app/notebooks/
25
- COPY --chown=jupyter:jupyter app.py /app/
26
- COPY --chown=jupyter:jupyter run.sh /app/
27
 
28
- # Make script executable
29
- RUN chmod +x /app/run.sh
30
-
31
- # Switch to non-root user
32
- USER jupyter
33
-
34
- # Expose port
35
- EXPOSE 7860
36
-
37
- # Start servers
38
- CMD ["/app/run.sh"]
 
1
+ FROM jupyter/base-notebook:python-3.9
2
 
3
+ # Install additional Python packages
4
+ RUN pip install numpy pandas matplotlib seaborn scikit-learn transformers torch
5
 
6
+ # Make port 8888 available for Jupyter
7
+ EXPOSE 8888
 
 
 
 
 
 
 
 
 
 
 
8
 
9
+ # Set the working directory
10
+ WORKDIR /home/jovyan/work
 
11
 
12
+ # Copy our sample notebook
13
+ COPY welcome.ipynb /home/jovyan/work/
 
 
14
 
15
+ # Set our entrypoint to start Jupyter without requiring a token
16
+ # and using the base URL required by Hugging Face Spaces
17
+ ENTRYPOINT ["jupyter", "notebook", "--ip=0.0.0.0", "--port=8888", "--no-browser", "--NotebookApp.token=''", "--NotebookApp.password=''", "--NotebookApp.allow_origin='*'", "--NotebookApp.base_url='/proxy/8888/'"]