Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
webservices
cern-search
cern-search-rest-api
Commits
9ba5f454
Commit
9ba5f454
authored
Feb 18, 2019
by
Pablo Panero
Browse files
docker: use pipenv only for dependecies management
parent
91931332
Changes
2
Hide whitespace changes
Inline
Side-by-side
Dockerfile
View file @
9ba5f454
...
...
@@ -13,34 +13,32 @@ RUN yum update -y && \
openldap-devel
\
https://linuxsoft.cern.ch/cern/centos/7/cern/x86_64/Packages/CERN-CA-certs-20180516-1.el7.cern.noarch.rpm
# Change to user invenio to install the instance
USER
invenio
# CERN Search installation
WORKDIR
/${WORKING_DIR}/src
ADD
. /${WORKING_DIR}/src
ENV
PIPENV_VENV_IN_PROJECT="/opt/invenio/src/"
ENV
PIPENV_CACHE_DIR="/opt/invenio/src/"
RUN if
[
-n
"
${
DEVEL
-
}
"
]
;
then
pipenv
install
-r
requirements-devel.txt
;
else
pipenv
install
-r
requirements.txt
;
fi
RUN
pipenv
install
-e
.[all,postgresql,elasticsearch6]
RUN
pipenv run invenio collect
-v
RUN
pipenv run invenio webpack buildall
RUN
mv
/
${
WORKING_DIR
}
/src/static/images/cernsearchicon.png
${
INVENIO_INSTANCE_PATH
}
/static/images/cernsearchicon.png
# Install dependencies globally
RUN
pipenv
install
--system
--deploy
# If env is development, install development dependencies
RUN if
[
-n
"
${
DEVEL
-
}
"
]
;
then
pip
install
-r
requirements-devel.txt
;
fi
# Install CSaS
RUN
pip
install
-e
.[all,postgresql,elasticsearch6]
# PID File for uWSGI
RUN
touch
/
${
WORKING_DIR
}
/src/uwsgi.pid
RUN
chmod
666 /
${
WORKING_DIR
}
/src/uwsgi.pid
# Patch auth
USER
root
RUN
chmod
+x /
${
WORKING_DIR
}
/src/scripts/patch/oauth_patch.sh
RUN
sh /
${
WORKING_DIR
}
/src/scripts/patch/oauth_patch.sh
# Install UI
USER
invenio
RUN
sh /
${
WORKING_DIR
}
/src/scripts/patch/oauth_patch.sh
RUN
invenio collect
-v
RUN
invenio webpack buildall
# Move static files to instance folder
RUN
mv
/
${
WORKING_DIR
}
/src/static/images/cernsearchicon.png
${
INVENIO_INSTANCE_PATH
}
/static/images/cernsearchicon.png
EXPOSE
5000
# uWSGI configuration
ARG
UWSGI_WSGI_MODULE=cern_search_rest_api.wsgi:application
...
...
@@ -52,8 +50,4 @@ ENV UWSGI_PROCESSES ${UWSGI_PROCESSES:-2}
ARG
UWSGI_THREADS=2
ENV
UWSGI_THREADS ${UWSGI_THREADS:-2}
EXPOSE
5000
CMD
["/bin/sh", "-c", "uwsgi --module ${UWSGI_WSGI_MODULE} --socket 0.0.0.0:${UWSGI_PORT} --master --processes ${UWSGI_PROCESSES} --threads ${UWSGI_THREADS} --stats /tmp/stats.socket"]
\ No newline at end of file
scripts/patch/oauth_patch.sh
View file @
9ba5f454
#!/usr/bin/env bash
location
=
$(
pipenv run
pip show invenio-oauthclient |
grep
Location |
awk
'{print $2}'
)
location
=
$(
pip show invenio-oauthclient |
grep
Location |
awk
'{print $2}'
)
rm
-f
${
location
}
/invenio_oauthclient/contrib/cern.py
cp
/
${
WORKING_DIR
}
/src/scripts/patch/cern.py
${
location
}
/invenio_oauthclient/contrib/cern.py
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment