Dockerfile.sandbox 1.18 KB
Newer Older
dengjb's avatar
dengjb committed
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
FROM python:3.11-slim-bookworm

WORKDIR /mnt/data

RUN apt-get update && apt-get install -y \
    gcc \
    libffi-dev \
    zlib1g-dev \
    fonts-arphic-ukai \
    fonts-arphic-uming \
    fonts-ipafont-mincho \
    fonts-ipafont-gothic \
    fonts-unfonts-core \
    libgdal-dev \
    g++ \
    && rm -rf /var/lib/apt/lists/*

RUN pip install --no-cache-dir \
    pydantic \
    tornado \
    jupyter_client \
    ipython \
    ipykernel \
    numpy \
    pandas \
    scipy \
    matplotlib \
    scikit-learn \
    notebook \
    beautifulsoup4 \
    seaborn \
    pytest \
    ipywidgets \
    sympy \
    statsmodels \
    joblib \
    cython \
    lxml \
    xlrd \
    qrcode \
    nltk \
    opencv-python \
    Pillow \
    geopandas

ENV HOME=/mnt/data

RUN find / -perm +6000 -type f -exec chmod a-s {} \; || true
RUN echo "set -o history -o vi" >> /etc/profile
RUN useradd -u 999 -ms /bin/bash appuser
RUN chown -R appuser:appuser /mnt/data
USER appuser

ENV JUPYTER_RUNTIME_DIR=/mnt/data/.local/share/jupyter/runtime
ENV JUPYTER_DATA_DIR=/mnt/data/.local/share/jupyter
ENV JUPYTER_CONFIG_DIR=/mnt/data/.jupyter

COPY sandbox.py /sandbox.py

VOLUME [ "/mnt/data" ]

CMD ["python", "/sandbox.py"]