Update Dockerfile
Browse files- Dockerfile +14 -4
Dockerfile
CHANGED
|
@@ -13,6 +13,7 @@ WORKDIR /app
|
|
| 13 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 14 |
git wget curl build-essential \
|
| 15 |
libglib2.0-0 libsm6 libxext6 libxrender1 libgomp1 \
|
|
|
|
| 16 |
&& rm -rf /var/lib/apt/lists/*
|
| 17 |
|
| 18 |
# fairseq 0.12.2 depends on old omegaconf metadata; pip >=24.1 rejects it.
|
|
@@ -48,13 +49,20 @@ RUN pip install \
|
|
| 48 |
RUN pip install "omegaconf==2.0.6" "hydra-core==1.0.7"
|
| 49 |
RUN pip install "fairseq==0.12.2"
|
| 50 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
RUN pip install -e /opt/MolScribe --no-deps
|
| 52 |
|
| 53 |
-
# Bring example images into the app working directory if the repo has them.
|
| 54 |
RUN cp -r /opt/MolScribe/examples /app/examples || mkdir -p /app/examples
|
| 55 |
|
| 56 |
-
#
|
| 57 |
RUN python - <<'PY'
|
|
|
|
|
|
|
| 58 |
import cv2
|
| 59 |
print("cv2 version:", cv2.__version__)
|
| 60 |
from SmilesPE.pretokenizer import atomwise_tokenizer
|
|
@@ -62,10 +70,12 @@ print("SmilesPE ok")
|
|
| 62 |
import onmt
|
| 63 |
print("onmt ok")
|
| 64 |
from molscribe import MolScribe
|
| 65 |
-
print("MolScribe ok")
|
| 66 |
from indigo import Indigo
|
| 67 |
from indigo.renderer import IndigoRenderer
|
| 68 |
-
|
|
|
|
|
|
|
| 69 |
PY
|
| 70 |
|
| 71 |
COPY app.py /app/app.py
|
|
|
|
| 13 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 14 |
git wget curl build-essential \
|
| 15 |
libglib2.0-0 libsm6 libxext6 libxrender1 libgomp1 \
|
| 16 |
+
libfreetype6 libfontconfig1 \
|
| 17 |
&& rm -rf /var/lib/apt/lists/*
|
| 18 |
|
| 19 |
# fairseq 0.12.2 depends on old omegaconf metadata; pip >=24.1 rejects it.
|
|
|
|
| 49 |
RUN pip install "omegaconf==2.0.6" "hydra-core==1.0.7"
|
| 50 |
RUN pip install "fairseq==0.12.2"
|
| 51 |
|
| 52 |
+
# Re-pin torch after dependencies, avoiding accidental torch upgrade by transitive deps.
|
| 53 |
+
RUN pip install --force-reinstall \
|
| 54 |
+
torch==1.13.1+cpu \
|
| 55 |
+
torchvision==0.14.1+cpu \
|
| 56 |
+
--extra-index-url https://download.pytorch.org/whl/cpu
|
| 57 |
+
|
| 58 |
RUN pip install -e /opt/MolScribe --no-deps
|
| 59 |
|
|
|
|
| 60 |
RUN cp -r /opt/MolScribe/examples /app/examples || mkdir -p /app/examples
|
| 61 |
|
| 62 |
+
# Import + renderer checks. Do NOT download/load the 1.13GB model here.
|
| 63 |
RUN python - <<'PY'
|
| 64 |
+
import ctypes.util
|
| 65 |
+
print("freetype:", ctypes.util.find_library("freetype"))
|
| 66 |
import cv2
|
| 67 |
print("cv2 version:", cv2.__version__)
|
| 68 |
from SmilesPE.pretokenizer import atomwise_tokenizer
|
|
|
|
| 70 |
import onmt
|
| 71 |
print("onmt ok")
|
| 72 |
from molscribe import MolScribe
|
| 73 |
+
print("MolScribe import ok")
|
| 74 |
from indigo import Indigo
|
| 75 |
from indigo.renderer import IndigoRenderer
|
| 76 |
+
indigo = Indigo()
|
| 77 |
+
renderer = IndigoRenderer(indigo)
|
| 78 |
+
print("Indigo renderer ok")
|
| 79 |
PY
|
| 80 |
|
| 81 |
COPY app.py /app/app.py
|