Skip to content

Commit 5f60c2d

Browse files
authored
Merge pull request #28 from MJedr/add-dockerfile
add dockerfile
2 parents 6159f67 + dc07a66 commit 5f60c2d

File tree

3 files changed

+68
-0
lines changed

3 files changed

+68
-0
lines changed

Dockerfile

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# -*- coding: utf-8 -*-
2+
#
3+
# This file is part of INSPIRE.
4+
# Copyright (C) 2016-2018 CERN.
5+
#
6+
# INSPIRE is free software: you can redistribute it and/or modify
7+
# it under the terms of the GNU General Public License as published by
8+
# the Free Software Foundation, either version 3 of the License, or
9+
# (at your option) any later version.
10+
#
11+
# INSPIRE is distributed in the hope that it will be useful,
12+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
# GNU General Public License for more details.
15+
#
16+
# You should have received a copy of the GNU General Public License
17+
# along with INSPIRE. If not, see <http://www.gnu.org/licenses/>.
18+
#
19+
# In applying this licence, CERN does not waive the privileges and immunities
20+
# granted to it by virtue of its status as an Intergovernmental Organization
21+
# or submit itself to any jurisdiction.
22+
23+
FROM pytorch/pytorch:0.4_cuda9_cudnn7
24+
25+
COPY instance-data /opt/conda/var/inspire_classifier.app-instance/
26+
COPY boot.sh requirements.txt /app/
27+
WORKDIR /app
28+
RUN apt-get update && apt-get -y install ffmpeg libglib2.0-0 libsm6 libxrender1 libxext6 build-essential git \
29+
&& python -m pip install pip --upgrade \
30+
&& pip install --upgrade --no-deps --force-reinstall https://download.pytorch.org/whl/cpu/torch-0.3.1-cp36-cp36m-linux_x86_64.whl \
31+
&& pip freeze \
32+
&& pip install --upgrade setuptools \
33+
&& pip install -r requirements.txt \
34+
&& pip freeze \
35+
&& apt-get -y remove build-essential git \
36+
&& apt-get -y autoremove && apt-get clean
37+
ENV LC_ALL=C.UTF-8
38+
ENV LANG=C.UTF-8
39+
ENTRYPOINT ["./boot.sh"]

boot.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
exec gunicorn -b :5000 --access-logfile - --error-logfile - inspire_classifier.app:app --timeout 90

requirements.txt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# -*- coding: utf-8 -*-
2+
#
3+
# This file is part of INSPIRE.
4+
# Copyright (C) 2016-2018 CERN.
5+
#
6+
# INSPIRE is free software: you can redistribute it and/or modify
7+
# it under the terms of the GNU General Public License as published by
8+
# the Free Software Foundation, either version 3 of the License, or
9+
# (at your option) any later version.
10+
#
11+
# INSPIRE is distributed in the hope that it will be useful,
12+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
# GNU General Public License for more details.
15+
#
16+
# You should have received a copy of the GNU General Public License
17+
# along with INSPIRE. If not, see <http://www.gnu.org/licenses/>.
18+
#
19+
# In applying this licence, CERN does not waive the privileges and immunities
20+
# granted to it by virtue of its status as an Intergovernmental Organization
21+
# or submit itself to any jurisdiction.
22+
23+
# work around the restriction on installing PyPI packages with non-PyPI deps
24+
git+https://github.com/inspirehep/inspire-classifier.git#egg=inspire-classifier
25+
gunicorn
26+
27+

0 commit comments

Comments
 (0)