Bozza Dockerfile per CGI Python
This commit is contained in:
commit
e3d1b88f93
|
@ -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"]
|
|
@ -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
|
Loading…
Reference in New Issue