Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
Save copy of Dockerfile in /github/workflows
  • Loading branch information
DrB-S authored Nov 10, 2023
1 parent 44d0b97 commit a8fa862
Showing 1 changed file with 48 additions and 8 deletions.
56 changes: 48 additions & 8 deletions .github/workflows/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,52 @@
FROM python:3.11.6-alpine
ARG HEATCLUSTER_VER="0.4.12"

COPY .github /app/
COPY assets /app/
COPY test /app/
COPY HeatCluster.py LICENSE README.md /app/
FROM ubuntu:jammy as app
USER root

WORKDIR /app
# re-instantiating for the app build layer if using ARG as a global variable above
ARG HEATCLUSTER_VER

RUN HeatCluster.py
LABEL base.image="ubuntu:jammy"
LABEL dockerfile.version="3"
LABEL software="HeatCluster"
LABEL software.version="${HEATCLUSTER_VER}"
LABEL description="This software produces a heatmap for a SNP matrix"
LABEL website="https://github.com/DrB-S/HeatCluster"
LABEL license="https://github.com/DrB-S/HeatCluster/blob/master/LICENSE"
LABEL name="heatcluster/${HEATCLUSTER_VER}"
LABEL maintainer="Stephen Beckstrom-Sternberg"
LABEL maintainer.email="[email protected]"

CMD
# Install Python and pip
RUN apt-get update && apt-get install -y --no-install-recommends \
apt-utils python3 python3-pip && \
apt-get clean && rm -rf /var/lib/apt/lists/*

# Install Python dependencies
RUN pip3 install pandas numpy pathlib seaborn matplotlib scipy

# Set /data as working dir
RUN mkdir /data
WORKDIR /data

RUN echo "installing heatcluster" && echo

COPY . .

RUN echo && echo && ls -latr /data && echo

# 'ENV' instructions set environment variables that persist from the build into the resulting image
# Use for e.g. $PATH and locale settings for compatibility with Singularity
ENV PATH="/heatcluster-${HEATCLUSTER_VER}/bin:$PATH" \
LC_ALL=C

FROM app as test

# print help and version info
# Mostly this ensures the tool of choice is in path and is executable
RUN echo && echo "Show heatcluster help file and program version number: " && echo && \
python3 HeatCluster.py --help && \
python3 HeatCluster.py --version

RUN echo && echo "Run a test matrix thru the program" && \
python3 HeatCluster.py -i test/snp-dists.txt && echo

0 comments on commit a8fa862

Please sign in to comment.