pplonski / my_ml_service

My Machine Learning Web Service

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue with dockerfile

rubhanraj opened this issue · comments

When I run the docker-compose build command, I get the following error:

#5 59.28 E: Unable to locate package python3.6
#5 59.28 E: Couldn't find any package by glob 'python3.6'
#5 59.28 E: Unable to locate package python3.6-dev
#5 59.28 E: Couldn't find any package by glob 'python3.6-dev'
#5 59.28 E: Couldn't find any package by regex 'python3.6-dev'

When I change the deadsnakes ppa like to the following:
sudo add-apt-repository ppa:fkrull/deadsnakes

I get the error below:

#11 46.38 Collecting scipy>=0.17.0 (from scikit-learn==0.21.3->-r requirements.txt (line 9))
#11 46.85 Downloading https://files.pythonhosted.org/packages/26/b5/9330f004b9a3b2b6a31f59f46f1617ce9ca15c0e7fe64288c20385a05c9d/scipy-1.8.1.tar.gz (38.2MB)
#11 84.80 Complete output from command python setup.py egg_info:
#11 84.80 Traceback (most recent call last):
#11 84.80 File "", line 1, in
#11 84.80 File "/tmp/pip-build-eq1_m9v_/scipy/setup.py", line 31, in
#11 84.80 raise RuntimeError("Python version >= 3.8 required.")
#11 84.80 RuntimeError: Python version >= 3.8 required.

Please could you help?

commented

What operating system are you using?

Hi Piotr!

I'm using MacOS Monterey. I have managed to make it work by using the following dockerfile and requirements.txt

`
FROM ubuntu:latest
ENV TZ=Europe/London
DEBIAN_FRONTEND=noninteractive

RUN apt-get update &&
apt-get install -y software-properties-common &&
add-apt-repository ppa:deadsnakes/ppa &&
apt-get update &&
apt-get install -y python3.9 python3.9-dev python3-pip python3.9-distutils

WORKDIR /app
COPY requirements.txt .
RUN rm -f /usr/bin/python && ln -s /usr/bin/python3.9 /usr/bin/python
RUN rm -f /usr/bin/python3 && ln -s /usr/bin/python3.9 /usr/bin/python3

RUN pip3 install -r requirements.txt
RUN pip3 install gunicorn==19.9.0

ADD ./backend /app/backend
ADD ./docker /app/docker
ADD ./research /app/research

#RUN mkdir -p /app/backend/server/staticfiles
RUN mkdir -p /app/backend/server/static
RUN chmod +x /app/docker/backend/wsgi-entrypoint.sh
`

Django==2.2.4 django-filter==2.2.0 djangorestframework==3.10.3 joblib==1.1.0 Markdown==3.1.1 numpy==1.22.4 pandas==1.4.2 requests==2.22.0 scikit-learn==1.1.1

Thanks,
Rubhan.