-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile
95 lines (72 loc) · 3.08 KB
/
Dockerfile
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
## TO BE UPDATED
FROM ubuntu:18.04
#MAINTAINER Thomas Rosnet
RUN apt-get update
RUN apt-get install -y git curl wget bzip2 vim lynx
#RUN apt-get install -y mongodb
RUN apt-get install -y gnupg2 unzip
RUN apt-get update -y
RUN apt-get install -y xvfb
# Adding trusting keys to apt for repositories
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
# Adding Google Chrome to the repositories
RUN sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
# Updating apt to see and install Google Chrome
RUN apt-get -y update
RUN apt-get install -y google-chrome-stable
# Install miniconda to /miniconda
RUN curl -LO http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
RUN bash Miniconda3-latest-Linux-x86_64.sh -p /miniconda -b
RUN rm Miniconda3-latest-Linux-x86_64.sh
ENV PATH=/miniconda/bin:${PATH}
RUN CHROMEDRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE` && \
wget https://chromedriver.storage.googleapis.com/$CHROMEDRIVER_VERSION/chromedriver_linux64.zip && \
unzip chromedriver_linux64.zip -d /usr/bin && \
chmod +x /usr/bin/chromedriver && \
rm chromedriver_linux64.zip
RUN CHROME_SETUP=google-chrome.deb && \
wget -O $CHROME_SETUP "https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb" && \
dpkg -i $CHROME_SETUP && \
apt-get install -y -f && \
rm $CHROME_SETUP
# # Install Chrome
# RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
# RUN sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
# RUN apt-get -y update
# RUN apt-get install -y google-chrome-stable
#
# # Install schrome-webdriver
# RUN apt-get install -yqq unzip
# RUN wget -O /tmp/chromedriver.zip http://chromedriver.storage.googleapis.com/`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`/chromedriver_linux64.zip
# RUN unzip /tmp/chromedriver.zip chromedriver -d /usr/local/bin/
# set display port to avoid crash
RUN xvfb :99 &
ENV DISPLAY=:99
SHELL ["/bin/bash", "-c"]
RUN conda update -y conda
# Initialize conda in bash config files:
RUN conda init bash
COPY environment.yml ./
RUN conda env create -f environment.yml
RUN source activate fair-checker-webapp
RUN echo "source activate fair-checker-webapp" > ~/.bashrc
ENV PATH /opt/conda/envs/fair-checker-webapp/bin:$PATH
ARG FLASK_ENV
ENV FLASK_ENV ${FLASK_ENV}
#RUN conda install flask rdflib pyopenssl -c conda-forge
#RUN pip install rdflib-jsonld
#RUN pip install Flask-SSLify
EXPOSE 5000
COPY app.py .
COPY templates templates
COPY static static
COPY metrics metrics
COPY launch.sh .
COPY config.py .
RUN chmod +x launch.sh
#ENTRYPOINT [ "sh", "./launch.sh" ]
#CMD [ "python3", "app.py"]
#CMD ["gunicorn" , "-b", "0.0.0.0:5000", "app:app"]
#ENTRYPOINT ["conda", "run", "-n", "fair-checker-webapp", "python3", "app.py"]
#ENTRYPOINT ["conda", "run", "-n", "fair-checker-webapp", "sh", "./launch.sh"]
CMD /bin/bash -c 'source activate fair-checker-webapp && sh ./launch.sh'