| FROM python:3.10-slim |
|
|
| |
| RUN apt-get update && apt-get install -y \ |
| curl wget fontconfig libgl1 libglib2.0-0 \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| RUN mkdir -p /usr/share/fonts/truetype/lxgw && \ |
| wget https://github.com/lxgw/LxgwWenKai/releases/download/v1.330/LXGWWenKai-Regular.ttf -O /usr/share/fonts/truetype/lxgw/LXGWWenKai-Regular.ttf && \ |
| fc-cache -fv |
|
|
| |
| RUN pip install --no-cache-dir numpy matplotlib notebook |
| RUN pip install jupyterlab-language-pack-zh-CN |
|
|
| |
| RUN useradd -m -u 1000 user |
| WORKDIR /home/user/app |
| RUN chown -R user:user /home/user/app |
|
|
| |
| USER user |
| ENV HOME=/home/user \ |
| PATH=/home/user/.local/bin:$PATH |
| |
| CMD ["jupyter", "notebook", "--ip=0.0.0.0", "--port=7860", "--no-browser", "--allow-root", "--ServerApp.token='pyweb1001'", "--ServerApp.password=''", "--ServerApp.allow_origin='*'", "--ServerApp.allow_remote_access=True", "--ServerApp.disable_check_xsrf=True", "--ServerApp.language='zh_CN'", "--ServerApp.tornado_settings={'headers':{'Content-Security-Policy':'frame-ancestors *'}}"] |
|
|