File size: 1,537 Bytes
0643282
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
cf32fe5
 
 
 
e9d0003
4ba94d8
e9d0003
0643282
 
 
708c3cf
6f2f943
 
708c3cf
6f2f943
 
 
 
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
36
37
38
39
40
41
42
43
44
# Start from the official Jupyter docker-stacks image for PySpark
FROM jupyter/pyspark-notebook:latest

# Switch to root to install OS-level packages if needed
USER root

# (Optional) Install extra system dependencies here, e.g.:
# RUN apt-get update && apt-get install -y vim && rm -rf /var/lib/apt/lists/*

# Switch back to the 'jovyan' user (the default user in jupyter docker-stacks)
USER $NB_UID

# Create a working directory (already set to /home/jovyan by default).
# We'll explicitly set it here for clarity.
WORKDIR /home/jovyan/work

# Copy any additional Python packages you need
COPY requirements.txt /tmp/requirements.txt
RUN pip install --no-cache-dir --upgrade pip && \
    pip install --no-cache-dir -r /tmp/requirements.txt || true

# Copy notebooks and data into the container
COPY notebooks/ notebooks/
COPY data/ data/


# Switch back to 'jovyan' user (the default in the jupyter/docker-stacks images)
USER $NB_UID

# Make sure 'jovyan' user owns these files/folders
#RUN chown -R jovyan:users /home/jovyan/work

# Expose Jupyter's default port
EXPOSE 8888

# Run Jupyter Notebook, disabling token & password, allow root access
CMD start.sh jupyter notebook \
    --ip=0.0.0.0 --port=8888 --no-browser \
    --allow-root\
    --NotebookApp.token= --NotebookApp.password= \
    --NotebookApp.allow_origin=* --NotebookApp.disable_check_xsrf=True \
    --NotebookApp.allow_remote_access=True \
    --NotebookApp.tornado_settings='{"headers":{"Content-Security-Policy":"frame-ancestors *","X-Frame-Options":"ALLOWALL"}}'