@@ -4,28 +4,25 @@ FROM ubuntu:22.04
44# Avoid prompts from apt
55ARG DEBIAN_FRONTEND=noninteractive
66
7- # Install Python and other dependencies, and apply updates
7+ # Install Python, git, and other dependencies, and apply updates
88RUN apt-get update && apt-get upgrade -y && \
99 apt-get install -y python3-pip python3-dev git && \
1010 apt-get clean && rm -rf /var/lib/apt/lists/*
1111
12+ # Argument to specify the commit, defaults to the 'main' branch
13+ ARG COMMIT_SHA=main
14+
1215# Set the working directory in the container
1316WORKDIR /usr/src/app
1417
15- # Clone the specific branch of the repository
16- RUN git clone https://github.com/AlexandrovLab/SigProfilerAssignment.git .
17-
18- # Install the dependencies from the requirements.txt in the cloned repository
19- RUN pip3 install --no-cache-dir -r requirements.txt
20-
21- # Install the SigProfilerAssignment package from PyPI
22- RUN pip3 install SigProfilerAssignment==0.1.8
18+ # Install the package directly from the specific commit on GitHub
19+ RUN pip3 install 'git+https://github.com/AlexandrovLab/SigProfilerAssignment.git@' ${COMMIT_SHA}
2320
24- # Create a non-root user named 'spm_user'
21+ # Create a non-root user
2522RUN useradd -m -s /bin/bash spm_user
2623
27- # Change the ownership of the /usr/src/app directory and its contents to the new non-root user
24+ # Change the ownership of the working directory
2825RUN chown -R spm_user:spm_user /usr/src/app
2926
30- # Switch to the non-root user for subsequent commands and when running the container
31- USER spm_user
27+ # Switch to the non-root user for security
28+ USER spm_user
0 commit comments