Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Dockerを使った可視化環境の作り方

Masa
March 24, 2019

 Dockerを使った可視化環境の作り方

Event:
- 2019/03/24 はんなりPython+PyData Osakaの可視化特集 https://goo.gl/dT1Dz3
Repository: https://git.io/fjJvi

Masa

March 24, 2019
Tweet

More Decks by Masa

Other Decks in Programming

Transcript

  1. できあがったDocker環境 +--------+ +-------+ +---------+ | | | | | |

    | Dash | ----- | MySQL | ------ | Jupyter | | | | | | | +--------+ +-------+ +---------+ | | +---------+ | | | +----------- | adminer | | | +---------+
  2. Dockerfle FROM python:3.7 # for dash RUN pip install dash==0.36.0

    RUN pip install dash-html-components==0.13.5 RUN pip install dash-core-components==0.43.0 RUN pip install dash-table==3.1.11 RUN pip install dash-daq==0.1.0 RUN pip install pandas RUN pip install mysql-connector-python==8.0.15 RUN export LANG=ja_JP.UTF-8
  3. docker-compose.yml version: '3.7' services: dash: build: context: ./dockerfiles dockerfile: Dockerfile.dash

    command: ["python", "/work/dash/app.py"] working_dir: /work depends_on: - db volumes: - ./:/work - ./logwh:/log ports: - 8050:8050
  4. docker-compose.yml db: image: mysql:8.0 command: - --default-authentication-plugin=mysql_native_password - --secure-file-priv=/log restart:

    always environment: MYSQL_ROOT_PASSWORD: root MYSQ_DATABASE: pydata ports: - 3306:3306 working_dir: /work volumes: - ./db/mysql/datadir:/var/lib/mysql - ./db/mysql/log:/var/log/mysql