UPD: so many improvements :)
This commit is contained in:
1 parent
aa1a4dbc72
commit
d219a6101f
18 files changed
+111
-39
No files matched your search
@@ -0,0 +1,18 @@
|
||||
WSGIDaemonProcess django-test display-name=django-test python-home=/srv/django-test/python python-path=/srv/django-test/django
|
||||
|
||||
Alias /static/ "/srv/django-test/django/var/www/static/"
|
||||
<Directory "/srv/django-test/django/var/www/static">
|
||||
AllowOverride None
|
||||
Require all granted
|
||||
</Directory>
|
||||
|
||||
WSGIScriptAlias / "/srv/django-test/django/main/wsgi.py"
|
||||
<Directory "/srv/django-test/django/main">
|
||||
WSGIProcessGroup django-test
|
||||
WSGIPassAuthorization On
|
||||
AllowOverride None
|
||||
Options FollowSymLinks
|
||||
<Files wsgi.py>
|
||||
Require all granted
|
||||
</Files>
|
||||
</Directory>
|
||||
+19
-7
@@ -2,17 +2,29 @@
|
||||
|
||||
### config ###
|
||||
PROJECT_NAME="django-test"
|
||||
PROJECT_REPO="git+https://heinzelwelt.de/vcs/python/django-test"
|
||||
SETUP_COMMAND="django-test-admin"
|
||||
|
||||
INSTALL_DIR="/var/www/wsgi/${PROJECT_NAME}"
|
||||
INSTALL_DIR="/srv/${PROJECT_NAME}"
|
||||
VENV_DIR="python"
|
||||
VENV_PATH="${INSTALL_DIR}/${VENV_DIR}"
|
||||
DJANGO_DIR="django"
|
||||
DJANGO_PATH="${INSTALL_DIR}/${DJANGO_DIR}"
|
||||
DJANGO_MAIN_MODULE="main"
|
||||
|
||||
PROJECT_REPO="git+https://heinzelwelt.de/vcs/python/django-test"
|
||||
|
||||
### argv ###
|
||||
if test "$1" != "" -a -d "$1" ; then
|
||||
PROJECT_REPO="$1"
|
||||
if test "$1" != "" ; then
|
||||
if test "$1" != "-" ; then
|
||||
INSTALL_DIR="$1"
|
||||
fi
|
||||
shift
|
||||
fi
|
||||
if test "$1" != "" ; then
|
||||
if test "$1" != "-" ; then
|
||||
PROJECT_REPO="$1"
|
||||
fi
|
||||
shift
|
||||
fi
|
||||
|
||||
### action ###
|
||||
@@ -21,13 +33,13 @@ python3 -m venv "${VENV_PATH}"
|
||||
source "${VENV_PATH}/bin/activate"
|
||||
pip install --upgrade pip
|
||||
pip install "$PROJECT_REPO"
|
||||
django-test-admin setup "${DJANGO_PATH}"
|
||||
$SETUP_COMMAND setup "${DJANGO_PATH}"
|
||||
python3 "${DJANGO_PATH}/manage.py" collectstatic --noinput
|
||||
|
||||
cat <<E-O-H >> "${DJANGO_PATH}/main/settings.py"
|
||||
cat <<E-O-H >> "${DJANGO_PATH}/${DJANGO_MAIN_MODULE}/settings.py"
|
||||
|
||||
ALLOWED_HOSTS = ['*']
|
||||
DEBUG = True
|
||||
DEBUG = False
|
||||
E-O-H
|
||||
|
||||
### end ###
|
||||
Executable
+16
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Disable CustomLog, that is configured by default in upstream.
|
||||
sed -i -e 's:^\(\s*\)\(CustomLog\s\s*"logs/access_log"\):\1# Disabled by /docker-entrypoint.sh # \2:' \
|
||||
/etc/httpd/conf/httpd.conf
|
||||
|
||||
# Remove left-overs from an incomplete shutdown previously.
|
||||
rm -rf /run/httpd/* /tmp/httpd*
|
||||
|
||||
if test "X${SERVER_ADMIN}" != "X" ; then
|
||||
set -- -c "ServerAdmin $SERVER_ADMIN" "$@"
|
||||
fi
|
||||
if test "X${LOG_LEVEL}" != "X" ; then
|
||||
set -- -c "LogLevel $LOG_LEVEL" "$@"
|
||||
fi
|
||||
exec /usr/sbin/httpd -DFOREGROUND "$@"
|
||||
@@ -1,18 +0,0 @@
|
||||
WSGIDaemonProcess django-test processes=1 threads=4 display-name=django-test python-home=/var/www/wsgi/django-test/python python-path=/var/www/wsgi/django-test/django
|
||||
|
||||
Alias /static/ "/var/www/wsgi/django-test/django/var/www/static/"
|
||||
<Directory "/var/www/wsgi/django-test/django/var/www/static">
|
||||
AllowOverride None
|
||||
Require all granted
|
||||
</Directory>
|
||||
|
||||
WSGIScriptAlias / "/var/www/wsgi/django-test/django/main/wsgi.py"
|
||||
<Directory "/var/www/wsgi/django-test/django/main">
|
||||
WSGIProcessGroup django-test
|
||||
WSGIPassAuthorization On
|
||||
AllowOverride None
|
||||
Options FollowSymLinks
|
||||
<Files wsgi.py>
|
||||
Require all granted
|
||||
</Files>
|
||||
</Directory>
|
||||
-2
@@ -1,6 +1,4 @@
|
||||
# /etc/httpd/conf.d/defaults.conf
|
||||
|
||||
ServerAdmin heinzel@heinzelwelt.de
|
||||
ServerTokens Prod
|
||||
ErrorLog /dev/stderr
|
||||
LogLevel info
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,2 +0,0 @@
|
||||
#!/bin/sh
|
||||
exec /usr/sbin/httpd -DFOREGROUND $@
|
||||
Reference in new issue
Block a user