GENOMICS-CDDBRG's picture
Upload 6 files
9cff291 verified
Raw History Blame Contribute Delete
1.91 kB
# Tool 1 needs real bioinformatics command line tools, not just Python packages,
# so this build uses micromamba/bioconda instead of a plain python base image.
FROM mambaorg/micromamba:1.5.8
# Build with --build-arg INSTALL_OPTIONAL=true to also install CheckM2, GTDB-Tk,
# geNomad, eggNOG-mapper, and AMRFinderPlus. These are large (multi-GB) and each
# still needs an external database mounted at runtime (see README.md), so they
# are skipped by default to keep the first build fast. The app already detects
# and gracefully skips any tool or database that is not present.
ARG INSTALL_OPTIONAL=false
USER root
WORKDIR /home/appuser/app
COPY environment-core.yml /tmp/environment-core.yml
RUN micromamba install -y -n base -f /tmp/environment-core.yml \
&& micromamba clean --all --yes
RUN if [ "$INSTALL_OPTIONAL" = "true" ]; then \
micromamba create -y -n checkm2 -c bioconda -c conda-forge checkm2 && \
micromamba create -y -n gtdbtk -c bioconda -c conda-forge gtdbtk && \
micromamba create -y -n genomad -c bioconda -c conda-forge genomad && \
micromamba create -y -n eggnog -c bioconda -c conda-forge eggnog-mapper && \
micromamba create -y -n amrfinder -c bioconda -c conda-forge ncbi-amrfinderplus && \
micromamba clean --all --yes ; \
else \
echo "Skipping optional database dependent tools. Set --build-arg INSTALL_OPTIONAL=true to include them." ; \
fi
COPY requirements.txt /tmp/requirements.txt
RUN micromamba run -n base pip install --no-cache-dir -r /tmp/requirements.txt
COPY app.py .
RUN mkdir -p /home/appuser/app/runs && chown -R $MAMBA_USER:$MAMBA_USER /home/appuser/app
USER $MAMBA_USER
# Hugging Face Docker Spaces expect the app to listen on port 7860
ENV PORT=7860 \
WORK_ROOT=/home/appuser/app/runs \
DEFAULT_THREADS=4
EXPOSE 7860
ENTRYPOINT ["/usr/local/bin/_entrypoint.sh"]
CMD ["python", "app.py"]