Skip to content

Instantly share code, notes, and snippets.

@BambooTuna
Created November 22, 2019 14:17
Show Gist options
  • Save BambooTuna/92f9cec9eea47c355e6f0852ea678c25 to your computer and use it in GitHub Desktop.
Save BambooTuna/92f9cec9eea47c355e6f0852ea678c25 to your computer and use it in GitHub Desktop.
【Python】dockerでサクッと画像処理環境を整える
version: "3.4"
services:
python3:
restart: always # OS起動時にコンテナを自動起動
build: .
tty: true
volumes:
- ./volume/opt/jupyter:/opt/python/jupyter
- ./volume/opt/jupyterlab:/opt/python/jupyterlab
- ./volume/opt/library:/opt/python/library
- $HOME/.Xauthority/:/root/.Xauthority
- /tmp/.X11-unix/:/tmp/.X11-unix
environment:
- DISPLAY=192.168.0.18:0
ports:
- 8888:8888
FROM python:3.7.3-slim-stretch
ENV PYTHONPATH "/opt/python/library"
COPY ./requirements.txt /tmp/requirements.txt
RUN apt-get update && \
apt-get install -y libopencv-dev
RUN set -x && \
pip install -U pip && \
pip install -r /tmp/requirements.txt && \
mkdir -p /opt/python/library && \
mkdir -p /opt/python/jupyter && \
mkdir -p /opt/python/jupyterlab && \
mkdir ~/.jupyter && \
cp /tmp/requirements.txt /opt/python/jupyterrequirements.txt && \
rm /tmp/requirements.txt
COPY ./jupyter_notebook_config.py /root/.jupyter/jupyter_notebook_config.py
EXPOSE 8888
CMD ["jupyter", "lab", "--allow-root"]
requests
jupyterlab==0.35.4
matplotlib==3.0.3
numpy==1.16.2
pandas==0.24.2
plotly==3.7.1
seaborn==0.9.0
statsmodels
scikit-learn
opencv-python
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment