Commit 9ba5f454 authored by Pablo Panero's avatar Pablo Panero
Browse files

docker: use pipenv only for dependecies management

parent 91931332
...@@ -13,34 +13,32 @@ RUN yum update -y && \ ...@@ -13,34 +13,32 @@ RUN yum update -y && \
openldap-devel \ openldap-devel \
https://linuxsoft.cern.ch/cern/centos/7/cern/x86_64/Packages/CERN-CA-certs-20180516-1.el7.cern.noarch.rpm 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 # CERN Search installation
WORKDIR /${WORKING_DIR}/src WORKDIR /${WORKING_DIR}/src
ADD . /${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] # Install dependencies globally
RUN pipenv install --system --deploy
RUN pipenv run invenio collect -v # If env is development, install development dependencies
RUN pipenv run invenio webpack buildall RUN if [ -n "${DEVEL-}" ]; then pip install -r requirements-devel.txt; fi
RUN mv /${WORKING_DIR}/src/static/images/cernsearchicon.png ${INVENIO_INSTANCE_PATH}/static/images/cernsearchicon.png # Install CSaS
RUN pip install -e .[all,postgresql,elasticsearch6]
# PID File for uWSGI # PID File for uWSGI
RUN touch /${WORKING_DIR}/src/uwsgi.pid RUN touch /${WORKING_DIR}/src/uwsgi.pid
RUN chmod 666 /${WORKING_DIR}/src/uwsgi.pid RUN chmod 666 /${WORKING_DIR}/src/uwsgi.pid
# Patch auth # Patch auth
USER root RUN sh /${WORKING_DIR}/src/scripts/patch/oauth_patch.sh
RUN chmod +x /${WORKING_DIR}/src/scripts/patch/oauth_patch.sh
# Install UI
USER invenio 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 # uWSGI configuration
ARG UWSGI_WSGI_MODULE=cern_search_rest_api.wsgi:application ARG UWSGI_WSGI_MODULE=cern_search_rest_api.wsgi:application
...@@ -52,8 +50,4 @@ ENV UWSGI_PROCESSES ${UWSGI_PROCESSES:-2} ...@@ -52,8 +50,4 @@ ENV UWSGI_PROCESSES ${UWSGI_PROCESSES:-2}
ARG UWSGI_THREADS=2 ARG UWSGI_THREADS=2
ENV UWSGI_THREADS ${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"] 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
#!/usr/bin/env bash #!/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 rm -f ${location}/invenio_oauthclient/contrib/cern.py
cp /${WORKING_DIR}/src/scripts/patch/cern.py ${location}/invenio_oauthclient/contrib/cern.py cp /${WORKING_DIR}/src/scripts/patch/cern.py ${location}/invenio_oauthclient/contrib/cern.py
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment