Skip to content

Commit

Permalink
add Dockerfile to base dir
Browse files Browse the repository at this point in the history
  • Loading branch information
j2salmingo committed Nov 12, 2024
1 parent 5b7a01a commit 5df4c95
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>" \
org.opencontainers.image.source=https://github.com/uclahs-cds/package-PipeVal

0 comments on commit 5df4c95

Please sign in to comment.