mirror of
https://github.com/deepset-ai/haystack.git
synced 2025-12-26 14:38:36 +00:00
Disable pip cache for Dockerfiles (#2015)
This commit is contained in:
parent
6267476015
commit
cb881b6fa9
1
.github/workflows/docker_build.yml
vendored
1
.github/workflows/docker_build.yml
vendored
@ -4,7 +4,6 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- docker-build
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
18
Dockerfile
18
Dockerfile
@ -2,24 +2,28 @@ FROM python:3.7.4-stretch
|
||||
|
||||
WORKDIR /home/user
|
||||
|
||||
RUN apt-get update && apt-get install -y curl git pkg-config cmake
|
||||
RUN apt-get update && apt-get install -y \
|
||||
curl \
|
||||
git \
|
||||
pkg-config \
|
||||
cmake \
|
||||
libpoppler-cpp-dev \
|
||||
tesseract-ocr \
|
||||
libtesseract-dev \
|
||||
poppler-utils && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install PDF converter
|
||||
RUN wget --no-check-certificate https://dl.xpdfreader.com/xpdf-tools-linux-4.03.tar.gz && \
|
||||
tar -xvf xpdf-tools-linux-4.03.tar.gz && cp xpdf-tools-linux-4.03/bin64/pdftotext /usr/local/bin
|
||||
|
||||
RUN apt-get install libpoppler-cpp-dev pkg-config -y --fix-missing
|
||||
|
||||
# Install Tesseract
|
||||
RUN apt-get install tesseract-ocr libtesseract-dev poppler-utils -y
|
||||
|
||||
# copy code
|
||||
COPY haystack /home/user/haystack
|
||||
|
||||
# install as a package
|
||||
COPY setup.py requirements.txt README.md /home/user/
|
||||
RUN pip install --upgrade pip
|
||||
RUN pip install -r requirements.txt
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
RUN pip install -e .
|
||||
RUN python3 -c "from haystack.utils.docker import cache_models;cache_models()"
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
FROM nvidia/cuda:11.1-runtime-ubuntu20.04
|
||||
FROM nvidia/cuda:11.1-runtime-ubuntu20.04
|
||||
|
||||
WORKDIR /home/user
|
||||
|
||||
@ -11,7 +11,7 @@ RUN mkdir -p /home/user/file-upload && chmod 777 /home/user/file-upload
|
||||
# Install software dependencies
|
||||
RUN apt-get update && apt-get install -y software-properties-common && \
|
||||
add-apt-repository ppa:deadsnakes/ppa && \
|
||||
apt-get update && apt-get install -y \
|
||||
apt-get install -y \
|
||||
cmake \
|
||||
curl \
|
||||
git \
|
||||
@ -25,7 +25,8 @@ RUN apt-get update && apt-get install -y software-properties-common && \
|
||||
python3.7-distutils \
|
||||
swig \
|
||||
tesseract-ocr \
|
||||
wget
|
||||
wget && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install PDF converter
|
||||
RUN curl -s https://dl.xpdfreader.com/xpdf-tools-linux-4.03.tar.gz | tar -xvzf - -C /usr/local/bin --strip-components=2 xpdf-tools-linux-4.03/bin64/pdftotext
|
||||
@ -40,9 +41,9 @@ COPY setup.py requirements.txt README.md /home/user/
|
||||
RUN pip install --upgrade pip
|
||||
RUN echo "Install required packages" && \
|
||||
# Install PyTorch for CUDA 11
|
||||
pip3 install torch==1.10.1+cu111 -f https://download.pytorch.org/whl/torch_stable.html && \
|
||||
# Install from requirements.txt
|
||||
pip3 install -r requirements.txt
|
||||
pip3 install --no-cache-dir torch==1.10.1+cu111 -f https://download.pytorch.org/whl/torch_stable.html && \
|
||||
# Install from requirements.txt
|
||||
pip3 install --no-cache-dir -r requirements.txt
|
||||
|
||||
# copy saved models
|
||||
COPY README.md models* /home/user/models/
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user