KamalamSivakumar commited on
Commit
1098470
·
verified ·
1 Parent(s): 89e8256

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -5
Dockerfile CHANGED
@@ -7,9 +7,6 @@ WORKDIR /app
7
  # Install Jupyter Notebook
8
  RUN pip install --no-cache-dir notebook
9
 
10
- # Create necessary directories for Jupyter runtime
11
- RUN mkdir -p /root/.local/share/jupyter/runtime
12
-
13
  # Copy your .ipynb file into the Docker container
14
  COPY ./Wallpaper_Preference_Learning.ipynb /app/Wallpaper_Preference_Learning.ipynb
15
 
@@ -19,8 +16,17 @@ COPY requirements.txt /app/requirements.txt
19
  # Install the dependencies
20
  RUN pip install --no-cache-dir -r requirements.txt
21
 
 
 
 
 
 
 
 
22
  # Expose the port that Jupyter Notebook will run on
23
- EXPOSE 7860 8888
24
 
25
- # Run Jupyter Notebook
 
 
26
  CMD ["jupyter", "notebook", "--ip=0.0.0.0", "--port=8888", "--no-browser", "--allow-root"]
 
7
  # Install Jupyter Notebook
8
  RUN pip install --no-cache-dir notebook
9
 
 
 
 
10
  # Copy your .ipynb file into the Docker container
11
  COPY ./Wallpaper_Preference_Learning.ipynb /app/Wallpaper_Preference_Learning.ipynb
12
 
 
16
  # Install the dependencies
17
  RUN pip install --no-cache-dir -r requirements.txt
18
 
19
+ # Create necessary directories and set permissions
20
+ RUN mkdir -p /root/.local/share/jupyter/runtime && \
21
+ mkdir -p /root/.local/share/jupyter && \
22
+ mkdir -p /root/.local/share && \
23
+ mkdir -p /root/.local && \
24
+ chmod -R 755 /root/.local
25
+
26
  # Expose the port that Jupyter Notebook will run on
27
+ EXPOSE 8888
28
 
29
+ # Run Jupyter Notebook as a non-root user
30
+ RUN useradd -m jupyteruser
31
+ USER jupyteruser
32
  CMD ["jupyter", "notebook", "--ip=0.0.0.0", "--port=8888", "--no-browser", "--allow-root"]