FROM jupyter/scipy-notebook:latest # Set the working directory to /app WORKDIR /app # Copy the requirements file and install Python dependencies COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy static files COPY public /app/public # Switch to root user to install system packages and set permissions USER root # Install necessary dependencies RUN apt-get update && apt-get install -y \ nginx \ && apt-get clean && rm -rf /var/lib/apt/lists/* # Copy the configuration files and entrypoint script COPY jupyter_config.py /etc/jupyter/jupyter_config.py COPY nginx.conf /etc/nginx/nginx.conf COPY entrypoint.sh /app/entrypoint.sh # Set the entrypoint script as executable RUN chmod +x /app/entrypoint.sh # Create necessary directories and set permissions RUN mkdir -p /data /var/log/nginx && \ chown -R ${NB_UID}:${NB_GID} /app /data /var/log/nginx /etc/nginx/nginx.conf && \ chmod 755 /data # Switch back to the original user USER ${NB_UID} # Set the working directory for the user WORKDIR /data # Expose the port for Nginx EXPOSE 7860 # Set the environment variables ENV JUPYTERLAB_PORT=8888 # Run the entrypoint script when the container starts ENTRYPOINT ["/app/entrypoint.sh"]