asv7j commited on
Commit
e62ec1b
·
verified ·
1 Parent(s): caaabd8

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -3
Dockerfile CHANGED
@@ -1,6 +1,9 @@
1
  # Use the official Jupyter Docker image
2
  FROM jupyter/base-notebook:latest
3
 
 
 
 
4
  # Install Jupyter Lab and additional packages
5
  RUN pip install --no-cache-dir \
6
  jupyterlab \
@@ -14,13 +17,16 @@ RUN pip install --no-cache-dir \
14
  pandas
15
 
16
  # Create a directory for the webpage
17
- RUN mkdir -p /srv/jupyterlab
18
 
19
  # Add the HTML file to the container
20
- COPY index.html /srv/jupyterlab/index.html
21
 
22
  # Expose the ports Jupyter Lab and web server will run on
23
  EXPOSE 8888 8000
24
 
 
 
 
25
  # Start both Jupyter Lab and the web server
26
- CMD ["sh", "-c", "jupyter lab --ip=0.0.0.0 --port=8888 --no-browser --allow-root --NotebookApp.token='' & cd /srv/jupyterlab && python3 -m http.server 8000"]
 
1
  # Use the official Jupyter Docker image
2
  FROM jupyter/base-notebook:latest
3
 
4
+ # Switch to the root user to perform privileged actions
5
+ USER root
6
+
7
  # Install Jupyter Lab and additional packages
8
  RUN pip install --no-cache-dir \
9
  jupyterlab \
 
17
  pandas
18
 
19
  # Create a directory for the webpage
20
+ RUN mkdir -p /home/jovyan/jupyterlab
21
 
22
  # Add the HTML file to the container
23
+ COPY index.html /home/jovyan/jupyterlab/index.html
24
 
25
  # Expose the ports Jupyter Lab and web server will run on
26
  EXPOSE 8888 8000
27
 
28
+ # Switch back to the notebook user
29
+ USER $NB_UID
30
+
31
  # Start both Jupyter Lab and the web server
32
+ CMD ["sh", "-c", "jupyter lab --ip=0.0.0.0 --port=8888 --no-browser --allow-root --NotebookApp.token='' & cd /home/jovyan/jupyterlab && python3 -m http.server 8000"]