-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
56 lines (42 loc) · 1.49 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
# -*- coding: utf-8 -*-
#
# Copyright (C) 2018 CERN.
#
# CERN Analysis Preservation is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
FROM gitlab-registry.cern.ch/analysispreservation/base:python3
# Install Invenio
ENV WORKING_DIR=/opt/cap
ENV INVENIO_INSTANCE_PATH=${WORKING_DIR}/var/instance
# Debug off by default
ARG DEBUG=False
ENV DEBUG=${DEBUG}
# copy everything inside /src
RUN mkdir -p ${WORKING_DIR}/src
COPY ./ ${WORKING_DIR}/src
WORKDIR ${WORKING_DIR}/src
ADD setup.py setup.py
ADD cap/version.py cap/version.py
RUN python -m site
RUN python -m site --user-site
# Install/create static files
RUN mkdir -p ${INVENIO_INSTANCE_PATH}
RUN pip install --upgrade wheel uwsgi uwsgitop uwsgi-tools
# RUN if [ "$DEBUG" = "True" ]; then pip install -r requirements-devel.txt; fi;
RUN pip install -r requirements.txt
RUN pip install -e .[all,xrootd]
RUN pip install -r requirements-local-forks.txt
# install debuger packages (only for dev use)
RUN pip install ipdb wdb
# copy uwsgi config files
COPY ./docker/uwsgi/ ${INVENIO_INSTANCE_PATH}
ARG APP_GITHUB_OAUTH_ACCESS_TOKEN
ENV APP_GITHUB_OAUTH_ACCESS_TOKEN=${APP_GITHUB_OAUTH_ACCESS_TOKEN}
ARG APP_GITLAB_OAUTH_ACCESS_TOKEN
ENV APP_GITLAB_OAUTH_ACCESS_TOKEN=${APP_GITLAB_OAUTH_ACCESS_TOKEN}
# Set folder permissions
RUN chgrp -R 0 ${WORKING_DIR} && \
chmod -R g=u ${WORKING_DIR}
RUN useradd invenio --uid 1000 --gid 0 && \
chown -R invenio:root ${WORKING_DIR}
USER 1000