File size: 1,058 Bytes
5b3c59f
 
 
 
 
 
 
27e88f5
5b3c59f
 
3dfe6ac
5b3c59f
ea25fee
 
 
 
89e8256
 
1098470
 
 
 
 
 
 
c79a3ec
025184b
c79a3ec
89e8256
025184b
89e8256
1098470
 
 
89e8256
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
27
28
29
30
31
32
33
34
35
# Use the official Python image from the Docker Hub
FROM python:3.9

# Set the working directory
WORKDIR /app

# Install Jupyter Notebook
RUN pip install --no-cache-dir notebook

# Copy your .ipynb file into the Docker container
COPY ./Wallpaper_Preference_Learning.ipynb /app/Wallpaper_Preference_Learning.ipynb

# Copy requirements.txt into the container
COPY requirements.txt /app/requirements.txt

# Install the dependencies
RUN pip install --no-cache-dir -r requirements.txt

# Create necessary directories and set permissions
RUN mkdir -p /root/.local/share/jupyter/runtime && \
    mkdir -p /root/.local/share/jupyter && \
    mkdir -p /root/.local/share && \
    mkdir -p /root/.local && \
    chmod -R 755 /root/.local

# Install additional language servers
RUN pip install python-language-server jedi

# Expose the port that Jupyter Notebook will run on
EXPOSE 7860 8888

# Run Jupyter Notebook as a non-root user
RUN useradd -m jupyteruser
USER jupyteruser
CMD ["jupyter", "notebook", "--ip=0.0.0.0", "--port=8888", "--no-browser", "--allow-root"]