Skip to content

Commit

Permalink
Moved mod_wsgi-express generated config out to the host filesystem. A…
Browse files Browse the repository at this point in the history
…dded several packages to assist with operations. Added a script to regenerate the mod_wsgi-express configuration in a comparison directory.
  • Loading branch information
rjsparks committed Jun 14, 2019
1 parent a969a8e commit 8f9a4c5
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
13 changes: 6 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,17 @@ FROM opensuse/leap
RUN zypper -n update && zypper -n install \
apache2 \
apache2-devel \
command-not-found \
gcc \
gcc-c++ \
less \
net-tools \
net-tools-deprecated \
python3 \
python3-devel \
python3-pip \
sudo
sudo \
vim

RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 5

Expand All @@ -29,11 +34,5 @@ RUN chown wwwrun:www /code/static
RUN mkdir /code/logs
RUN chown wwwrun:www /code/logs


RUN echo "SECRET_KEY='garbage'" > ietf/settings/local.py
ENV DJANGO_SETTINGS_MODULE=ietf.settings.production
RUN ./manage.py runmodwsgi --setup-only --port 8001 --user wwwrun --group www --access-log --server-root /code/mod_wsgi-express-8001 --log-directory /code/logs
RUN rm ietf/settings/local.py

ENTRYPOINT ./docker-entry.sh

12 changes: 11 additions & 1 deletion docker-entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,19 @@ if [ -n "${WWWRUN_UID}" -o -n "${WWW_GID}" ]; then
chown -R wwwrun:www /code
fi

if [ ! -f "ietf/settings/local.py" ]; then
echo "local.py not found. Exiting."
exit 1
fi

if [ ! -d "mod_wsgi-express-8001" ]; then
echo "mod_wsgi-express-8001 not found. Exiting."
exit 1
fi

./mod_wsgi-express-8001/apachectl start

echo "[hit enter key to exit] or run 'docker stop <container>'"
echo "Successfully started. [hit enter key to exit] or run 'docker stop <container>'"
read

./mod_wsgi-express-8001/apachectl stop
Expand Down
5 changes: 5 additions & 0 deletions regenerate_wsgi_config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

rm -rf /code/mod_wsgi-express-8001/regeneration
DJANGO_SETTINGS_MODULE=ietf.settings.production ./manage.py runmodwsgi --setup-only --port 8001 --user wwwrun --group www --access-log --server-root /code/mod_wsgi-express-8001/regeneration --log-directory /code/logs
echo "This directory is for comparison only. It is not used by the running server. It was created by "$0" at " `date` > /code/mod_wsgi-express-8001/regeneration/README

0 comments on commit 8f9a4c5

Please sign in to comment.