Commit 9d659ae9 authored by Daniel Schreiber's avatar Daniel Schreiber

Files zum Erzeugen des Containers

parent de1ee339
Pipeline #28163 failed with stage
in 22 seconds
FROM debian:buster
RUN apt-get update && apt-get -y upgrade
RUN apt-get install -y uwsgi python3.7 uwsgi-plugin-python3 python3-venv git libpq-dev libmariadb-dev
COPY install.sh /tmp/install.sh
COPY frms.ini /etc/uwsgi/apps-enabled
COPY startsync.sh /var/www/django/frms/startsync.sh
COPY startuwsgi.sh /var/www/django/frms/startuwsgi.sh
RUN chmod 755 /var/www/django/frms/startsync.sh
RUN chmod 755 /var/www/django/frms/startuwsgi.sh
RUN bash /tmp/install.sh
EXPOSE 8000
ENV DOCKER=1
VOLUME ["/var/www/django/frms/logs", "/var/www/django/frms/private"]
ENTRYPOINT ["/var/www/django/frms/startuwsgi.sh"]
[uwsgi]
plugin = python37,logfile
vassal_name = frms
gid=www-data
uid=www-data
;socket = /run/uwsgi/frms.sock
;chmod-socket = 660
http-socket = 0.0.0.0:8000
master = true
virtualenv = /var/www/django/frms/env/
chdir = /var/www/django/frms/app/
wsgi-file = frms/wsgi.py
processes = 4
threads = 2
logger = file:logfile=/var/www/django/frms/logs/uwsgi.log,maxsize=2097152,backupname=/var/www/django/frms/logs/uwsgi.log.old
attach-daemon2 = cmd=/var/www/django/frms/startsync.sh,pidfile=/tmp/sync.pid
static-map = /static=/var/www/django/frms/static
#!/usr/bin/env bash
TARGET=/var/www/django/frms
mkdir -p /var/www/django/frms/logs
git clone https://gitlab.hrz.tu-chemnitz.de/saxid-federated-resource-management/frms.git $TARGET/app
cd $TARGET/app
git checkout docker
python3 -mvenv $TARGET/env
source $TARGET/env/bin/activate
cd $TARGET/app
pip install -r requirements.txt
mkdir -p $TARGET/static
chown www-data: $TARGET/static
#!/usr/bin/env bash
/var/www/django/frms/env/bin/python /var/www/django/frms/app/sync.py --pidfile=/tmp/sync.pid
#!/usr/bin/env bash
FRMS_DIR=/var/www/django/frms
if [[ ! -f $FRMS_DIR/private/settings_docker.py ]]; then
cat <<EOF
settings_docker.py fehlt im Volume, das in /var/www/django/frms/private
gemountet wird. Darin müssen die Hochschulspezifischen Einstellungen gemacht
werden.
SERVER_REALM="..." # hs-mittweida.de
HTTP_SERVER_NAME="..." # https://saxid-api.hs-mittweida.de
ALLOWED_HOSTS = [""] # saxid-api.hs-mittweida.de
DATABASES = {
}
EOF
exit
fi
chown -R www-data:www-data "${FRMS_DIR}/logs"
su www-data -s /bin/bash -c "${FRMS_DIR}/env/bin/python ${FRMS_DIR}/app/manage.py migrate"
su www-data -s /bin/bash -c "${FRMS_DIR}/env/bin/python ${FRMS_DIR}/app/manage.py collectstatic"
/usr/bin/uwsgi --ini /etc/uwsgi/apps-enabled/frms.ini
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment