Bozza Dockerfile per CGI Python

This commit is contained in:
giuliof 2021-03-24 22:21:32 +01:00
commit e3d1b88f93
2 changed files with 50 additions and 0 deletions

13
cgi-python/Dockerfile Normal file
View File

@ -0,0 +1,13 @@
FROM alpine:latest
COPY install.sh /install.sh
RUN apk add thttpd
RUN apk add python
RUN apk add py-pip
CMD install.sh
# TODO: integrare in install?
# TODO: opzioni per cgi
ENTRYPOINT ["thttpd -D -d /srv/cgi"]

37
cgi-python/install.sh Normal file
View File

@ -0,0 +1,37 @@
#!/bin/bash
function die {
echo -e "Qualcosa è andato storto"
exit -1
}
DEPLOY_DIR="/srv/cgi"
CFG_DIR="/srv/cfg"
# Lista dei repository CGI
REPO[0]="https://git.golem.linux.it/golem/zerocalcare.git"
REPO[1]="https://git.golem.linux.it/golem/tpdf.git"
# ... aggiungi qui altri repository, basta che rispettino le specifiche
# descritte nel readme
cd $DEPLOY_DIR
# Che bello il bash e la sua sintassi creativa, no?
for url in ${REPO[*]}; do
PRJ_DIR=$(basename "$url" .git)
git clone $url
test $? -eq 0 || die
pushd $PRJ_DIR
# Link template to the actual configuration
ln -s $CFG_DIR/$PRJ_DIR.conf.ini conf/conf.custom.ini
test $? -eq 0 || die
pip install -r requirements.txt
popd
done
exit 0