forked from kobotoolbox/kobocat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.kobocat_base
44 lines (32 loc) · 1.48 KB
/
Dockerfile.kobocat_base
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
# vim: syntax=dockerfile:
# Base image to take care of installing `apt` and `pip` requirements. Also clones the `kobocat-template` repo.
FROM qeddockerhub/base-kobos:latest
ENV KOBOCAT_TMP_DIR=/srv/kobocat_tmp \
# Store editable packages (pulled from VCS repos) in their own directory.
PIP_EDITABLE_PACKAGES_DIR=/srv/pip_editable_packages \
UWSGI_USER=wsgi \
UWSGI_GROUP=wsgi
###########################
# Install `apt` packages. #
###########################
COPY ./apt_requirements.txt ${KOBOCAT_TMP_DIR}/base_apt_requirements.txt
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y $(cat ${KOBOCAT_TMP_DIR}/base_apt_requirements.txt) && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
###########################
# Install `pip` packages. #
###########################
COPY ./requirements/ ${KOBOCAT_TMP_DIR}/base_requirements/
RUN mkdir -p ${PIP_EDITABLE_PACKAGES_DIR} && \
pip install --upgrade 'pip>=10,<11' && \
pip install --src ${PIP_EDITABLE_PACKAGES_DIR}/ -r ${KOBOCAT_TMP_DIR}/base_requirements/base.pip && \
pip install --src ${PIP_EDITABLE_PACKAGES_DIR}/ -r ${KOBOCAT_TMP_DIR}/base_requirements/s3.pip && \
rm -rf ~/.cache/pip
################################
# Install `kobocat-templates`. #
################################
RUN mkdir -p /srv/src && \
cd /srv/src && \
git clone --depth 1 https://github.com/qedsoftware/kobocat-template.git -b master && \
chown -R ${UWSGI_USER} /srv/src/kobocat-template