# 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"]