File size: 1,057 Bytes
cab6030
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
FROM python:3.11-slim-bookworm

# libgomp is the OpenMP runtime LightGBM links against; the slim image does not ship it.
RUN apt-get update && apt-get install -y --no-install-recommends libgomp1 \
    && rm -rf /var/lib/apt/lists/*

# DIAMOND provides the homology search. 2.2.8 matches training and has --hit-membuf.
ADD https://github.com/bbuchfink/diamond/releases/download/v2.2.8/diamond-linux64.tar.gz /tmp/d.tar.gz
RUN tar -xzf /tmp/d.tar.gz -C /usr/local/bin diamond && rm /tmp/d.tar.gz && diamond version

RUN useradd --create-home --uid 1000 user
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir --extra-index-url https://download.pytorch.org/whl/cpu -r requirements.txt
COPY --chown=user:user . .

# Built here, not by predict.py, so that no large file is ever written during inference.
RUN gunzip -c weights/train_db.fa.gz | diamond makedb -d weights/train --quiet \
    && chown user:user weights/train.dmnd

USER user
ENV OMP_NUM_THREADS=2 OPENBLAS_NUM_THREADS=2 MKL_NUM_THREADS=2
CMD ["python", "/app/predict.py", "--help"]