Monday, 10 May 2021

Install pydrill in Docker image

I have this docker file based on alpine that installs several packages with conda. At the end installs pydrill with pip as there's no conda installation.

from jcrist/alpine-dask

RUN /opt/conda/bin/conda update -n base -c defaults conda -y
RUN /opt/conda/bin/conda update dask
RUN /opt/conda/bin/conda install -c conda-forge dask-ml
RUN /opt/conda/bin/conda install scikit-learn -y
RUN /opt/conda/bin/conda install flask -y
RUN /opt/conda/bin/conda install waitress -y
RUN /opt/conda/bin/conda install gunicorn -y
RUN /opt/conda/bin/conda install pytest -y
RUN /opt/conda/bin/conda install apscheduler -y
RUN /opt/conda/bin/conda install matplotlib -y
RUN /opt/conda/bin/conda install pyodbc -y

USER root
RUN apk update
RUN apk add py-pip
RUN pip install pydrill

When I build the docker image everything works fine. But when I run the container the command line starts gunicorn, but it fails with the following message:

  File "/code/app/service/cm/exec/run_drill.py", line 1, in <module>
    from pydrill.client import PyDrill
   
   ModuleNotFoundError: No module named 'pydrill'

Is this pip installation correct? This is the docker compose:

version: "3.0"
services:

  web:
    image: img-dask
    volumes:
      - vol_py_code:/code
      - vol_dask_data:/data
      - vol_dask_model:/model
    ports:
      - "5000:5000"
    working_dir: /code
    environment:
      - app.config=/code/conf/py.app.json
      - common.config=/code/conf/py.common.json     
    entrypoint:
      - /opt/conda/bin/gunicorn
    command:
      - -b 0.0.0.0:5000
      - --reload
      - app.frontend.app:app
     ......


from Install pydrill in Docker image

No comments:

Post a Comment