From 90fb4b213aa9a2516a25a5754a3a32bd781dba53 Mon Sep 17 00:00:00 2001 From: Léo Vansimay Date: Fri, 16 Apr 2021 09:36:56 +0200 Subject: Create Dockerfile Adding the Dockerfile to the repo, we can build the container with it, and run the demo script (/!\reminder: 3 hours long to run) Next step is to push the image to DockerHub, so we won't need to build the image anymore.--- Dockerfile | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Dockerfile (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..3ac77ff2 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,33 @@ +FROM ubuntu + +#installing dependencies +RUN apt-get update +RUN apt-get install python3 -y +RUN apt-get install python3-pip -y +RUN apt-get install python3-venv -y +RUN apt-get install git -y +#------installing the needed thing for PyPDF2 and pdftotext------------------------------------- +RUN DEBIAN_FRONTEND="noninteractive" apt-get -y install tzdata +RUN apt-get install build-essential libpoppler-cpp-dev pkg-config python3-dev poppler-utils -y +RUN apt-get install libqpdf-dev -y +RUN apt-get install pkg-config -y +#----------------------------------------------------------------------------------------------- + + +RUN git clone https://github.com/crocs-muni/sec-certs.git /opt/sec-certs + +#creating the venv in a way that works, the activation script doesn't work in Docker, we do manualy what it does +ENV VIRTUAL_ENV=/opt/venv +RUN python3 -m venv $VIRTUAL_ENV +ENV PATH="$VIRTUAL_ENV/bin:$PATH" + +# Install dependencies: +RUN cp /opt/sec-certs/requirements.txt . +RUN pip install wheel +RUN pip install -r requirements.txt +#just to be sure that pdftotext is in $PATH +ENV PATH /usr/bin/pdftotext:${PATH} + + +# Run the application: +CMD ["python3", "/opt/sec-certs/cc_oop_demo.py"] -- cgit v1.3.1 From ed69fdd0c83160653ee363ef2b3ebfe0783db88e Mon Sep 17 00:00:00 2001 From: Léo Vansimay Date: Fri, 23 Apr 2021 11:31:54 +0200 Subject: Update Dockerfile Modified the path of the demo script.--- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index 3ac77ff2..e891e9a5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,4 +30,4 @@ ENV PATH /usr/bin/pdftotext:${PATH} # Run the application: -CMD ["python3", "/opt/sec-certs/cc_oop_demo.py"] +CMD ["python3", "/opt/sec-certs/examples/cc_oop_demo.py"] -- cgit v1.3.1