summaryrefslogtreecommitdiffhomepage
path: root/docker/Dockerfile
blob: a4eff99c34160760439b06abe35d3ad4b6e47b78 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
FROM ubuntu

ENV USER="user"
ENV HOME /home/${USER}

#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
RUN apt-get install curl -y
RUN apt-get install python3.8-venv -y

# Install dependencies fo 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 apt-get install default-jdk -y
RUN apt-get install graphviz -y

RUN adduser --disabled-password \
    --gecos "Default user" \
    ${USER}
USER ${USER}
WORKDIR ${HOME}

# TODO: Change dev to master
# Download only snapshot of repository
RUN \
  curl -L https://api.github.com/repos/crocs-muni/sec-certs/tarball/master > sec-certs.tar.gz && \
  mkdir sec-certs && \
  tar zxf sec-certs.tar.gz --strip-components=1 --directory sec-certs && \
  rm sec-certs.tar.gz

WORKDIR ${HOME}/sec-certs

# Create virtual environment
ENV VENV_PATH=${HOME}/venv
RUN python3 -m venv ${VENV_PATH}
ENV PATH="${VENV_PATH}/bin:$PATH"

# Install dependencies, notebook is because of mybinder.org
RUN \
    pip3 install wheel && \
    pip3 install -r requirements.txt && \
    pip3 install --no-cache notebook

# #just to be sure that pdftotext is in $PATH
ENV PATH /usr/bin/pdftotext:${PATH}

# # Run the application:
# CMD ["python3", "./cc_cli.py"]