From 5df4c9544bb89b8925a05dca9d5079f69b896eff Mon Sep 17 00:00:00 2001 From: Joseph Salmingo Date: Tue, 12 Nov 2024 09:49:58 -0800 Subject: [PATCH] add Dockerfile to base dir --- Dockerfile | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0bd7e55 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,51 @@ +ARG MINIFORGE_VERSION=22.9.0-2 +ARG UBUNTU_VERSION=20.04 + +FROM condaforge/mambaforge:${MINIFORGE_VERSION} AS builder + +# Use conda to install tools and dependencies into /usr/local +ARG PYTHON_VERSION=3.10 +ARG VCFTOOLS_VERSION=0.1.16 +RUN mamba create -qy -p /usr/local \ + -c bioconda \ + -c conda-forge \ + python==${PYTHON_VERSION} \ + vcftools==${VCFTOOLS_VERSION} \ + perl-vcftools-vcf==${VCFTOOLS_VERSION} \ + tabix \ + pip + +# Deploy the target tools into a base image +FROM ubuntu:${UBUNTU_VERSION} AS final +COPY --from=builder /usr/local /usr/local + +RUN apt-get update && apt-get install -y --no-install-recommends \ + libmagic1 && \ + rm -rf /var/lib/apt/lists/* && \ + rm -rf /tmp/downloaded_packages/ /tmp/*.rds + +# create directory for python script +RUN mkdir -p /tool/validate/ + +# install all requirements, including validate module +# COPY requirements.txt /tool +COPY setup.py /tool +COPY setup.cfg /tool +COPY pyproject.toml /tool +COPY /pipeval /tool/pipeval +WORKDIR /tool +RUN pip install build && \ + pip install . + +# add tool folder to path +ENV PYTHONPATH "${PYTHONPATH}:/tool/" + +# Add a new user/group called bldocker +RUN groupadd -g 500001 bldocker && \ + useradd -r -u 500001 -g bldocker bldocker + +# Change the default user to bldocker from root +USER bldocker + +LABEL maintainer="Yash Patel " \ + org.opencontainers.image.source=https://github.com/uclahs-cds/package-PipeVal