UPD: everything is better now :)
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1 +1 @@
|
||||
django-test
|
||||
src/django-test
|
||||
|
||||
@@ -8,7 +8,7 @@ RUN dnf -y update && \
|
||||
|
||||
COPY container-files/httpd-layer/ /
|
||||
|
||||
COPY django-test /srv/src/django-test
|
||||
COPY src/django-test /srv/src/django-test
|
||||
COPY container-files/django-test-layer/ /
|
||||
RUN /srv/bin/setup-django-test.sh /srv/django-test /srv/src/django-test
|
||||
|
||||
|
||||
17
Makefile
17
Makefile
@@ -1,17 +1,28 @@
|
||||
APPLICATION_NAME := django-test
|
||||
IMAGE_NAME := heinzel/$(APPLICATION_NAME)
|
||||
REPO_URL := https://heinzelwelt.de/vcs/python/django-test
|
||||
REPO_DIR := src/$(APPLICATION_NAME)
|
||||
IMAGE_NAME := $(APPLICATION_NAME)
|
||||
|
||||
DOCKER := docker
|
||||
GIT := git
|
||||
|
||||
.PHONY: default help image run
|
||||
.PHONY: default help image test-run dist-clean
|
||||
|
||||
default: image
|
||||
|
||||
help:
|
||||
@echo "There is no help."
|
||||
|
||||
image:
|
||||
$(REPO_DIR):
|
||||
$(GIT) clone $(REPO_URL) $@
|
||||
|
||||
$(IMAGE_NAME): $(REPO_DIR)
|
||||
$(DOCKER) build -t $(IMAGE_NAME) .
|
||||
|
||||
image: $(IMAGE_NAME)
|
||||
|
||||
test-run:
|
||||
$(DOCKER) run -ti --rm -p 80:80 $(IMAGE_NAME)
|
||||
|
||||
dist-clean:
|
||||
-rm -rf $(REPO_DIR)
|
||||
|
||||
14
README.rst
14
README.rst
@@ -5,7 +5,7 @@ Docker container for django-test.
|
||||
|
||||
DESCRIPTION
|
||||
===========
|
||||
The docker image is derivated from
|
||||
The django-heinzel docker image is derivated from
|
||||
Fedora image (https://hub.docker.com/_/fedora).
|
||||
|
||||
It will contain and run
|
||||
@@ -17,13 +17,17 @@ It will contain and run
|
||||
|
||||
BUILD
|
||||
=====
|
||||
- ``git clone https://heinzelwelt.de/vcs/python/django-test``
|
||||
- ``make``
|
||||
|
||||
or alternatively the *long* way:
|
||||
|
||||
- ``git clone https://heinzelwelt.de/vcs/python/django-test src/django-test``
|
||||
- ``docker build -t IMAGE_NAME .``
|
||||
|
||||
|
||||
USAGE
|
||||
=====
|
||||
- ``docker run -d -p 80:80 -e LOG_LEVEL=error IMAGE_NAME``
|
||||
- ``docker run -d -p 80:80 -e SERVER_ADMIN=heinzel@heinzelwelt.de IMAGE_NAME``
|
||||
|
||||
The httpd process is listening on port 80/tcp.
|
||||
|
||||
@@ -35,9 +39,9 @@ CONFIGURATION
|
||||
=============
|
||||
The following **environment variables** are supported:
|
||||
|
||||
- LOG_LEVEL
|
||||
- LOG_LEVEL (default: error)
|
||||
-- to set the httpd LogLevel directive
|
||||
- SERVER_ADMIN
|
||||
- SERVER_ADMIN (default: root@localhost)
|
||||
-- to set the httpd ServerAdmin directive
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#!/bin/sh
|
||||
DEFAULT_LOG_LEVEL="error"
|
||||
|
||||
# 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:' \
|
||||
@@ -10,7 +11,5 @@ 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
|
||||
set -- -c "LogLevel ${LOG_LEVEL:-${DEFAULT_LOG_LEVEL}}" "$@"
|
||||
exec /usr/sbin/httpd -DFOREGROUND "$@"
|
||||
|
||||
Reference in New Issue
Block a user