From 16e23f3750cd9a8a7957dcde333f3aacbdd807f7 Mon Sep 17 00:00:00 2001 From: northwestwitch Date: Fri, 20 Nov 2020 08:24:26 +0100 Subject: [PATCH 1/5] Created a runnable Dockerfile --- CHANGELOG.md | 5 ++--- Dockerfile | 25 +++++++++++++++++++++++++ README.md | 18 ++++++++++++++---- 3 files changed, 41 insertions(+), 7 deletions(-) create mode 100644 Dockerfile diff --git a/CHANGELOG.md b/CHANGELOG.md index 49c1d322..166d9503 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,12 +4,11 @@ This change log will document the notable changes to this project in this file a ## [x.x.x] ### Added -- Sample views +- Sample views - Batch views +- Dockerfile ### Fixed ### Changed - Changed name of package to NIPTool - - diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..bbe1aa6c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,25 @@ +FROM python:3.8-slim + +LABEL base_image="python:3.8-slim" +LABEL about.home="https://github.com/Clinical-Genomics/NIPTool" +LABEL about.tags="NIPT,statistics,Non Invasive Prenatal Test,python" + +# Install required libs +#UN apk update +#RUN apk --no-cache add make automake gcc g++ + +WORKDIR /home/worker/app +COPY . /home/worker/app + +# Install app requirements +RUN pip install -r requirements.txt + +# Install app +RUN pip install -e . + +# Create and switch to a new non-root user +RUN useradd worker +RUN chown worker:worker -R /home/worker +USER worker + +ENTRYPOINT ["nipt"] diff --git a/README.md b/README.md index b10de355..36cc5e88 100644 --- a/README.md +++ b/README.md @@ -30,16 +30,26 @@ nipt run ``` And play around with the interface. +### Docker image + +NIPTool can be runned also as a container. The image is available [on Docker Hub](https://hub.docker.com/repository/docker/clinicalgenomics/niptool) or can be build using the Dockerfile provided in this repository. + +To build a new image from the Dockerfile use the commands: `docker build -t niptool .` + +To run the image use the following command: docker run --name niptool niptool + +To remove the container, type: `docker rm niptool` + ## Release model NIPTool development is organised on a flexible Git "Release Flow" branching system. This more or less means that we make releases in release branches which corresponds to stable versions of NIPTool. ### Steps to make a new release: -1) Create a release branch from master named `version_X.X.X` +1) Create a release branch from master named `version_X.X.X` 2) Update change log with the new version. 3) Update NIPTool/__init__.py with the new version. -4) Make a PR to master, +4) Make a PR to master, - Name PR `release version X.X.X` - Justify if its a patch/minor/major version bump - Paste the latest changelog to the text body @@ -67,7 +77,7 @@ The database is loaded through the CLI with data generated by the [FluFFyPipe](h ## CLI The CLI has two base commands - load and run. The load command is for loading batch and sample data into the nipt database, and the run command is for running the web application. -### Load +### Load ``` @@ -75,7 +85,7 @@ Usage: nipt -c load batch [OPTIONS] ... ``` - + ### Run ``` Usage: nipt run [OPTIONS] ... From 32dd79520885906bdef32bf20f0ae9e6802c72f9 Mon Sep 17 00:00:00 2001 From: northwestwitch Date: Fri, 20 Nov 2020 08:26:44 +0100 Subject: [PATCH 2/5] fixed readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 36cc5e88..22c9699b 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ NIPTool can be runned also as a container. The image is available [on Docker Hub To build a new image from the Dockerfile use the commands: `docker build -t niptool .` -To run the image use the following command: docker run --name niptool niptool +To run the image use the following command: `docker run --name niptool niptool` To remove the container, type: `docker rm niptool` From 0ca55ba7b7889fda6ef6648af131522025a7ff94 Mon Sep 17 00:00:00 2001 From: northwestwitch Date: Fri, 20 Nov 2020 08:28:41 +0100 Subject: [PATCH 3/5] removed unused commented lines --- Dockerfile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index bbe1aa6c..6f69eac1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,10 +4,6 @@ LABEL base_image="python:3.8-slim" LABEL about.home="https://github.com/Clinical-Genomics/NIPTool" LABEL about.tags="NIPT,statistics,Non Invasive Prenatal Test,python" -# Install required libs -#UN apk update -#RUN apk --no-cache add make automake gcc g++ - WORKDIR /home/worker/app COPY . /home/worker/app From 14d28ead0734c7f88f8e236386767b6f0711d0a4 Mon Sep 17 00:00:00 2001 From: northwestwitch Date: Fri, 20 Nov 2020 08:59:44 +0100 Subject: [PATCH 4/5] Remove entrypoint in Dockerfile --- Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6f69eac1..9a7a23e8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,5 +17,3 @@ RUN pip install -e . RUN useradd worker RUN chown worker:worker -R /home/worker USER worker - -ENTRYPOINT ["nipt"] From 66a5d7b1cac2f0859f71ebe2115ded1581c8e706 Mon Sep 17 00:00:00 2001 From: northwestwitch Date: Fri, 20 Nov 2020 11:17:47 +0100 Subject: [PATCH 5/5] fix readme after removing ENTRYPOINT --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 22c9699b..3a20de3c 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ NIPTool can be runned also as a container. The image is available [on Docker Hub To build a new image from the Dockerfile use the commands: `docker build -t niptool .` -To run the image use the following command: `docker run --name niptool niptool` +To run the image use the following command: `docker run --name niptool niptool nipt ` To remove the container, type: `docker rm niptool`