Unverified Commit 4ef12240 authored by step21's avatar step21 Committed by GitHub

Docker Setup with Apache 2 and mod_wsgi and updated requirements and scratch file (#18)

* Dockerfile and corresponding apache2 config with mod_wsgi

* updated packages in requirements.txt

* added SCRATCHPAD as scratchpad file
parent 5611a037
FROM debian:stretch
LABEL maintainer="step21 <step21@devtal.de>"
ENV LANG C.UTF-8
RUN mkdir /web;mkdir /web/poeticrelief
WORKDIR /web/poeticrelief
RUN apt-get update -y && DEBIAN_FRONTEND=noninteractive apt-get install -y python3.5 apache2 libapache2-mod-wsgi-py3 python3-pip python3-setuptools python3-wheel sqlite3 curl && apt-get clean && rm -rf /var/lib/apt/lists/*
COPY ./ /web/poeticrelief
RUN pip3 install -r /web/poeticrelief/requirements-py3.txt
# Apache conf
RUN a2enmod wsgi rewrite
COPY poeticrelief-wsgi.conf /etc/apache2/sites-available/
RUN a2ensite poeticrelief-wsgi
RUN curl --output /web/poeticrelief/poerelief/teidb_dev.sqlite https://chaostal.de/~step21/teidb_dev.sqlite
EXPOSE 80
CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND", "-e", "info"]
#from parse_bfs
#return render_template("index.html", pg=s.id + s.loc s.translation)
#implement doc call giving record as json
#javascript to switch texts
......@@ -7,6 +7,6 @@ SQLALCHEMY_TRACK_MODIFICATIONS = True
DEV = True
if DEV == True:
#This means the 127.0.0.1:5000 displayed by flask might not work
SERVER_NAME = "localhost:5000"
SERVER_NAME = "localhost"
else:
SERVER_NAME = "www.poeticrelief.org"
<VirtualHost *:80>
ServerAdmin step21@chaostal.de
ServerName localhost
ServerAlias poeticrelief.dev
WSGIDaemonProcess poeticrelief user=www-data group=www-data threads=5
WSGIScriptAlias / /web/poeticrelief/start.wsgi
<Directory /web/poeticrelief/>
WSGIProcessGroup poeticrelief
WSGIApplicationGroup %{GLOBAL}
Require all granted
</Directory>
# ErrorLog /var/log/apache2/poeticrelief-err.log
LogLevel info
ErrorLog /web/poeticrelief-err.log
CustomLog /web/poeticrelief-access.log combined
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
Flask==0.12.2
Flask==0.12.3
Flask-SQLAlchemy==2.2
Flask-PyMongo
pymongo==2.8
Flask-PyMongo==2.2.0
pymongo==3.0
Jinja2==2.7.3
MarkupSafe==0.23
SQLAlchemy==1.1.14
......
Flask==0.12.2
Flask==0.12.3
Flask-SQLAlchemy==2.2
Flask-PyMongo
pymongo==2.8
Flask-PyMongo==2.2.0
pymongo==3.0
Jinja2==2.7.3
MarkupSafe==0.23
SQLAlchemy==1.1.14
......@@ -13,5 +13,4 @@ requests
#either should be fine, adjust as needed
flipflop
flup6
#not supported, needs mongokit-py3 or similar
#mongokit
#!/usr/bin/env python3
import sys
import six
#sys.path.insert(0, "$HOME/poerelief")
sys.path.insert(0, "/web/poeticrelief")
sys.path.insert(0, "/web/poeticrelief/poerelief")
#if six.PY2:
#in principle flup6 should work for p2 and p3
# from flup.server.fcgi import WSGIServer
#else:
# from flup6.server.fcgi import WSGIServer
#with open('/tmp/pr-d.txt','w') as f:
# f.write("foo")
from poerelief import app as application
if __name__ == '__main__':
# WSGIServer(application).run()
application.run()
application.run()
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