-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
64 lines (54 loc) · 2.68 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
# Dockerfile that builds a fully functional image of Knowledge Commons Works
#
# This image installs all Python dependencies for Knowledge Commons Works.
# It's based
# on Almalinux (https://github.com/inveniosoftware/docker-invenio)
# and includes Pip, Pipenv, Node.js, NPM and some few standard libraries
# Invenio usually needs.
#
# Note: It is important to keep the commands in this file in sync with your
# bootstrap script located in ./scripts/bootstrap.
FROM registry.cern.ch/inveniosoftware/almalinux:1
# TODO: Add env variables below?
# ENV PYTHONDONTWRITEBYTECODE 1
# ENV PYTHONFAULTHANDLER 1
# Install prerequisites for building xmlsec Python package
# also adds ps command for debugging
RUN dnf install libxml2-devel xmlsec1-devel xmlsec1-openssl-devel libtool-ltdl-devel procps -y
# Copy over directory for kcr instance Python package
COPY site ./site
COPY Pipfile Pipfile.lock ./
# NOTE: turned off --deploy for dev
RUN pipenv install --system
RUN echo "[cli]" >> .invenio.private && \
echo "services_setup=False" >> .invenio.private && \
echo "instance_path=/opt/invenio/var/instance" >> .invenio.private
# Copying whole app directory into /opt/invenio/src
# (WORKDIR is set to that folder in base image)
COPY ./ .
ENV INVENIO_INSTANCE_PATH=/opt/invenio/var/instance \
INVENIO_SITE_UI_URL=https://localhost \
INVENIO_SITE_API_URL=https://localhost \
MIGRATION_SERVER_DOMAIN=localhost \
MIGRATION_SERVER_PROTOCOL=http \
MIGRATION_API_TOKEN=changeme
RUN cp -r ./docker/uwsgi/uwsgi_rest.ini ${INVENIO_INSTANCE_PATH}/uwsgi_rest.ini && \
cp -r ./docker/uwsgi/uwsgi_ui.ini ${INVENIO_INSTANCE_PATH}/uwsgi_ui.ini && \
cp -r ./docker/startup_ui.sh ${INVENIO_INSTANCE_PATH}/startup_ui.sh && \
cp -r ./docker/startup_api.sh ${INVENIO_INSTANCE_PATH}/startup_api.sh && \
cp -r ./docker/startup_worker.sh ${INVENIO_INSTANCE_PATH}/startup_worker.sh && \
cp ./invenio.cfg ${INVENIO_INSTANCE_PATH}/invenio.cfg && \
cp -r ./templates ${INVENIO_INSTANCE_PATH}/templates && \
cp -r ./app_data/ ${INVENIO_INSTANCE_PATH}/app_data
RUN chmod +x ${INVENIO_INSTANCE_PATH}/startup_ui.sh && \
chmod +x ${INVENIO_INSTANCE_PATH}/startup_api.sh && \
chmod +x ${INVENIO_INSTANCE_PATH}/startup_worker.sh
RUN invenio collect --verbose && invenio webpack clean create && \
mkdir -p ${INVENIO_INSTANCE_PATH}/assets/less && \
cp ./assets/less/theme.config ${INVENIO_INSTANCE_PATH}/assets/less/theme.config && \
mkdir -p ${INVENIO_INSTANCE_PATH}/assets/templates/custom_fields && \
mkdir -p ${INVENIO_INSTANCE_PATH}/assets/templates/search && \
invenio webpack install && \
invenio shell ./scripts/symlink_assets.py && \
invenio webpack build
ENTRYPOINT ["bash", "-c"]