This repository has been archived by the owner on May 3, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 35
/
Dockerfile
50 lines (42 loc) · 1.6 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
# This file is part of Invenio Demosite.
# Copyright (C) 2015 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# Invenio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Invenio; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
# based on the right Invenio base image
FROM invenio:latest
# get root rights again
USER root
# add content
ADD . /code-overlay
WORKDIR /code-overlay
# fix requirements.txt and install additional dependencies
RUN sed -i '/inveniosoftware\/invenio[@#]/d' requirements.txt && \
pip install -r requirements.txt --exists-action i
# build
RUN python setup.py compile_catalog
# step back
# in general code should not be writeable, especially because we are using
# `pip install -e`
RUN mkdir -p /code-overlay/src && \
chown -R invenio:invenio /code-overlay && \
chown -R root:root /code-overlay/invenio_demosite && \
chown -R root:root /code-overlay/setup.* && \
chown -R root:root /code-overlay/src
# add volumes
# do this AFTER `chown`, because otherwise directory permissions are not
# preserved
VOLUME /code-overlay
# finally step back again
USER invenio