Initial
This commit is contained in:
17
Dockerfile
Normal file
17
Dockerfile
Normal file
@@ -0,0 +1,17 @@
|
||||
FROM fedora
|
||||
|
||||
RUN dnf -y update && \
|
||||
dnf -y install httpd && \
|
||||
dnf -y install python3-mod_wsgi && \
|
||||
dnf -y install git && \
|
||||
dnf clean all
|
||||
|
||||
COPY container-files/ /
|
||||
|
||||
RUN /usr/local/bin/install-django-test.sh
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
ENTRYPOINT ["/usr/local/sbin/start-httpd.sh"]
|
||||
CMD ["--"]
|
||||
|
||||
18
Makefile
Normal file
18
Makefile
Normal file
@@ -0,0 +1,18 @@
|
||||
APPLICATION_NAME := django-test
|
||||
IMAGE_NAME := heinzel/$(APPLICATION_NAME)
|
||||
|
||||
DOCKER := docker
|
||||
|
||||
.PHONY: default help image run
|
||||
|
||||
default: image
|
||||
|
||||
help:
|
||||
@echo "There is no help."
|
||||
|
||||
image:
|
||||
$(DOCKER) build -t $(IMAGE_NAME) .
|
||||
|
||||
test-run:
|
||||
$(DOCKER) run -ti -p 80:80 --name $(APPLICATION_NAME) $(IMAGE_NAME)
|
||||
$(DOCKER) rm $(APPLICATION_NAME)
|
||||
6
container-files/etc/httpd/conf.d/defaults.conf
Normal file
6
container-files/etc/httpd/conf.d/defaults.conf
Normal file
@@ -0,0 +1,6 @@
|
||||
# /etc/httpd/conf.d/defaults.conf
|
||||
|
||||
ServerAdmin heinzel@heinzelwelt.de
|
||||
ServerTokens Prod
|
||||
ErrorLog /dev/stderr
|
||||
LogLevel info
|
||||
18
container-files/etc/httpd/conf.d/django-test.conf
Normal file
18
container-files/etc/httpd/conf.d/django-test.conf
Normal file
@@ -0,0 +1,18 @@
|
||||
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>
|
||||
0
container-files/etc/httpd/conf.d/welcome.conf
Normal file
0
container-files/etc/httpd/conf.d/welcome.conf
Normal file
15
container-files/etc/httpd/conf.d/zzz-lock-down.conf
Normal file
15
container-files/etc/httpd/conf.d/zzz-lock-down.conf
Normal file
@@ -0,0 +1,15 @@
|
||||
# /etc/httpd/conf.d/zzz-lock-down.conf
|
||||
|
||||
<Directory "/var/www">
|
||||
Require all denied
|
||||
</Directory>
|
||||
<Directory "/var/www/html">
|
||||
Require all denied
|
||||
</Directory>
|
||||
<Directory "/var/www/cgi-bin">
|
||||
Require all denied
|
||||
</Directory>
|
||||
<Directory "/usr/share/httpd/icons">
|
||||
Require all denied
|
||||
</Directory>
|
||||
|
||||
33
container-files/etc/httpd/conf.modules.d/00-base.conf
Normal file
33
container-files/etc/httpd/conf.modules.d/00-base.conf
Normal file
@@ -0,0 +1,33 @@
|
||||
#
|
||||
# This file loads most of the modules included with the Apache HTTP
|
||||
# Server itself.
|
||||
#
|
||||
|
||||
LoadModule access_compat_module modules/mod_access_compat.so
|
||||
LoadModule actions_module modules/mod_actions.so
|
||||
LoadModule alias_module modules/mod_alias.so
|
||||
LoadModule allowmethods_module modules/mod_allowmethods.so
|
||||
LoadModule auth_basic_module modules/mod_auth_basic.so
|
||||
LoadModule authn_core_module modules/mod_authn_core.so
|
||||
LoadModule authn_file_module modules/mod_authn_file.so
|
||||
LoadModule authz_core_module modules/mod_authz_core.so
|
||||
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
|
||||
LoadModule authz_host_module modules/mod_authz_host.so
|
||||
LoadModule authz_user_module modules/mod_authz_user.so
|
||||
LoadModule autoindex_module modules/mod_autoindex.so
|
||||
LoadModule deflate_module modules/mod_deflate.so
|
||||
LoadModule dir_module modules/mod_dir.so
|
||||
LoadModule env_module modules/mod_env.so
|
||||
LoadModule expires_module modules/mod_expires.so
|
||||
LoadModule headers_module modules/mod_headers.so
|
||||
LoadModule info_module modules/mod_info.so
|
||||
LoadModule log_config_module modules/mod_log_config.so
|
||||
LoadModule mime_magic_module modules/mod_mime_magic.so
|
||||
LoadModule mime_module modules/mod_mime.so
|
||||
LoadModule negotiation_module modules/mod_negotiation.so
|
||||
LoadModule request_module modules/mod_request.so
|
||||
LoadModule rewrite_module modules/mod_rewrite.so
|
||||
LoadModule setenvif_module modules/mod_setenvif.so
|
||||
LoadModule status_module modules/mod_status.so
|
||||
LoadModule unixd_module modules/mod_unixd.so
|
||||
|
||||
0
container-files/etc/httpd/conf.modules.d/10-h2.conf
Normal file
0
container-files/etc/httpd/conf.modules.d/10-h2.conf
Normal file
24
container-files/usr/local/bin/install-django-test.sh
Executable file
24
container-files/usr/local/bin/install-django-test.sh
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/bin/sh
|
||||
|
||||
DJANGO_PROJECT_NAME="django-test"
|
||||
PROJECT_REPO_URL="git+https://heinzelwelt.de/vcs/python/django-test"
|
||||
|
||||
BASE_DIR="/var/www/wsgi/${DJANGO_PROJECT_NAME}"
|
||||
VENV_DIR="python"
|
||||
VENV_PATH="${BASE_DIR}/${VENV_DIR}"
|
||||
DJANGO_DIR="django"
|
||||
DJANGO_PATH="${BASE_DIR}/${DJANGO_DIR}"
|
||||
|
||||
mkdir -p "$BASE_DIR"
|
||||
python3 -m venv "${VENV_PATH}"
|
||||
source "${VENV_PATH}/bin/activate"
|
||||
pip install --upgrade pip
|
||||
pip install "$PROJECT_REPO_URL"
|
||||
django-test-admin setup "${DJANGO_PATH}"
|
||||
python3 "${DJANGO_PATH}/manage.py" collectstatic --noinput
|
||||
|
||||
cat <<E-O-H >> "${DJANGO_PATH}/main/settings.py"
|
||||
|
||||
ALLOWED_HOSTS = ['*']
|
||||
DEBUG = True
|
||||
E-O-H
|
||||
2
container-files/usr/local/sbin/start-httpd.sh
Executable file
2
container-files/usr/local/sbin/start-httpd.sh
Executable file
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
exec /usr/sbin/httpd -DFOREGROUND $@
|
||||
Reference in New Issue
Block a user