2021-03-12 17:48:39 +01:00
|
|
|
# FROM python:3.8.5-alpine
|
|
|
|
FROM python:3.8.6-slim-buster
|
2021-02-06 16:13:47 +01:00
|
|
|
|
|
|
|
# set working directory
|
|
|
|
WORKDIR /usr/src
|
|
|
|
|
|
|
|
# add args for installing from self-hosted packages
|
|
|
|
ARG pip_extra_index_url_flag='--extra-index-url https://pip.grassrootseconomics.net:8433'
|
|
|
|
|
2021-03-12 17:48:39 +01:00
|
|
|
RUN apt-get update && \
|
2021-03-30 09:22:29 +02:00
|
|
|
apt install -y gcc gnupg libpq-dev wget make g++ gnupg bash procps git python-pycurl libcurl4-openssl-dev libssl-dev
|
2021-02-06 16:13:47 +01:00
|
|
|
|
2021-03-05 17:28:07 +01:00
|
|
|
# create secrets directory
|
|
|
|
RUN mkdir -vp pgp/keys
|
|
|
|
|
2021-02-06 16:13:47 +01:00
|
|
|
# create application directory
|
|
|
|
RUN mkdir -vp cic-ussd
|
2021-03-05 20:09:22 +01:00
|
|
|
RUN mkdir -vp data
|
2021-02-06 16:13:47 +01:00
|
|
|
|
|
|
|
COPY cic-ussd/setup.cfg \
|
|
|
|
cic-ussd/setup.py \
|
|
|
|
cic-ussd/
|
|
|
|
|
|
|
|
COPY cic-ussd/requirements.txt \
|
|
|
|
cic-ussd/test_requirements.txt \
|
|
|
|
cic-ussd/
|
|
|
|
|
|
|
|
# install requirements
|
|
|
|
RUN cd cic-ussd && \
|
|
|
|
pip install -r requirements.txt $pip_extra_index_url_flag
|
|
|
|
|
|
|
|
# copy all necessary files
|
|
|
|
COPY cic-ussd/cic_ussd/ cic-ussd/cic_ussd/
|
2021-03-05 20:09:22 +01:00
|
|
|
COPY cic-ussd/cic_ussd/db/ussd_menu.json data/
|
2021-02-06 16:13:47 +01:00
|
|
|
COPY cic-ussd/scripts/ cic-ussd/scripts/
|
|
|
|
COPY cic-ussd/states/ cic-ussd/states/
|
|
|
|
COPY cic-ussd/transitions/ cic-ussd/transitions/
|
|
|
|
COPY cic-ussd/var/ cic-ussd/var/
|
|
|
|
|
|
|
|
COPY cic-ussd/docker/db.sh \
|
|
|
|
cic-ussd/docker/start_tasker.sh \
|
|
|
|
cic-ussd/docker/start_uwsgi.sh \
|
|
|
|
/root/
|
|
|
|
|
|
|
|
RUN chmod +x /root/*.sh
|
2021-02-10 18:48:24 +01:00
|
|
|
RUN cd cic-ussd && \
|
|
|
|
pip install $pip_extra_index_url_flag .
|
2021-02-06 16:13:47 +01:00
|
|
|
|
|
|
|
|
|
|
|
# copy config and migration files to definitive file so they can be referenced in path definitions for running scripts
|
|
|
|
COPY cic-ussd/.config/ /usr/local/etc/cic-ussd/
|
|
|
|
COPY cic-ussd/cic_ussd/db/migrations/ /usr/local/share/cic-ussd/alembic
|
2021-02-22 18:51:57 +01:00
|
|
|
|
|
|
|
WORKDIR /root
|