|
FROM jupyter/scipy-notebook:latest |
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
COPY requirements.txt . |
|
RUN pip install --no-cache-dir -r requirements.txt |
|
|
|
|
|
COPY public /app/public |
|
|
|
|
|
USER root |
|
|
|
|
|
RUN apt-get update && apt-get install -y \ |
|
nginx \ |
|
&& apt-get clean && rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
COPY jupyter_config.py /etc/jupyter/jupyter_config.py |
|
COPY nginx.conf /etc/nginx/nginx.conf |
|
COPY entrypoint.sh /app/entrypoint.sh |
|
|
|
|
|
RUN chmod +x /app/entrypoint.sh |
|
|
|
|
|
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 |
|
|
|
|
|
USER ${NB_UID} |
|
|
|
|
|
WORKDIR /data |
|
|
|
|
|
RUN --mount=type=secret,id=JUPYTER_TOKEN,mode=0444,required=true \ |
|
export JUPYTER_TOKEN=$(cat /run/secrets/JUPYTER_TOKEN) |
|
|
|
|
|
EXPOSE 7860 |
|
|
|
|
|
ENTRYPOINT ["/app/entrypoint.sh"] |