FROM continuumio/miniconda3:24.11.1-0 AS cheminf-python-ms # ---------- build-time proxy args ---------- ENV PYTHON_VERSION=3.11 \ INCLUDE_OCSR=false \ WORKERS=1 \ PYTHONUNBUFFERED=1 \ PYTHONDONTWRITEBYTECODE=1 \ http_proxy=${http_proxy} \ https_proxy=${https_proxy} \ no_proxy=${no_proxy} \ HTTP_PROXY=${http_proxy} \ HTTPS_PROXY=${https_proxy} \ NO_PROXY=${no_proxy} # Optional: help APT when /etc/apt/apt.conf.d is respected (env is usually enough) # RUN printf 'Acquire::http::Proxy "%s";\nAcquire::https::Proxy "%s";\n' "$http_proxy" "$https_proxy" \ # > /etc/apt/apt.conf.d/80proxy # Install runtime dependencies RUN apt-get update && \ apt-get install -y --no-install-recommends \ software-properties-common \ openjdk-17-jre-headless \ curl \ build-essential \ wget && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* && \ # Create arch-independent JAVA_HOME symlink ln -sf /usr/lib/jvm/java-17-openjdk-$(dpkg --print-architecture) /usr/lib/jvm/java-17-openjdk && \ wget "https://github.com/StructureGenerator/surge/releases/download/v2.0/surge-linux-x86_64.tar.gz" && \ tar xzf surge-linux-x86_64.tar.gz && \ mv surge /usr/bin/surge && \ chmod +x /usr/bin/surge && \ rm surge-linux-x86_64.tar.gz ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk/ ARG RELEASE_VERSION=1.0 ENV RELEASE_VERSION=${RELEASE_VERSION} WORKDIR /code COPY requirements_lite.txt . # conda/pip will honor proxy env above RUN conda install -c conda-forge python=${PYTHON_VERSION} sqlite --force-reinstall && \ python3 -m pip install --no-cache-dir -U pip setuptools && \ pip3 install --no-cache-dir -r requirements_lite.txt && \ pip3 install --no-cache-dir --no-deps chembl_structure_pipeline COPY ./app /code/app RUN useradd -m -r appuser && chown -R appuser:appuser /code USER appuser # ---------- runtime: keep proxies available for the app too ---------- # (pystow/urllib need them at runtime to fetch the JAR) ENV HTTP_PROXY=${HTTP_PROXY} \ HTTPS_PROXY=${HTTPS_PROXY} \ NO_PROXY=${NO_PROXY} \ http_proxy=${http_proxy} \ https_proxy=${https_proxy} \ no_proxy=${no_proxy} CMD ["sh", "-c", "uvicorn app.main:app --host 0.0.0.0 --port 80 --workers ${WORKERS}"]