cic-internal-integration/apps/cic-ussd/docker/Dockerfile

55 lines
1.5 KiB
Docker
Raw Permalink Normal View History

2021-02-06 16:13:47 +01:00
FROM python:3.8.5-alpine
# 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'
# add alpine sys packages
RUN apk update && \
apk add git linux-headers postgresql-dev gnupg bash
RUN apk add --update musl-dev gcc libffi-dev
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