Use a config file for uwsgi.
This commit is contained in:
@@ -32,10 +32,6 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- /opt/mailman/web:/opt/mailman-web-data
|
- /opt/mailman/web:/opt/mailman-web-data
|
||||||
environment:
|
environment:
|
||||||
- UWSGI_WSGI_FILE=wsgi.py
|
|
||||||
- UWSGI_HTTP=:8000
|
|
||||||
- UWSGI_WORKERS=2
|
|
||||||
- UWSGI_THREADS=4
|
|
||||||
- DATABASE_URL=postgres://mailman:mailmanpass@database/mailmandb
|
- DATABASE_URL=postgres://mailman:mailmanpass@database/mailmandb
|
||||||
- HYPERKITTY_API_KEY=someapikey
|
- HYPERKITTY_API_KEY=someapikey
|
||||||
networks:
|
networks:
|
||||||
|
|||||||
@@ -10,20 +10,16 @@ RUN apt-get update \
|
|||||||
postgresql-client \
|
postgresql-client \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
RUN wget -O mailmanclient.zip https://gitlab.com/mailman/mailmanclient/repository/archive.zip?ref=master \
|
RUN python -m pip install -U mailmanclient==3.1.0 \
|
||||||
&& wget -O postorius.zip https://gitlab.com/mailman/postorius/repository/archive.zip?ref=master \
|
postorius==1.1.0 \
|
||||||
&& wget -O django-mailman3.zip https://gitlab.com/mailman/django-mailman3/repository/archive.zip?ref=master \
|
hyperkitty==1.1.0 \
|
||||||
&& wget -O hyperkitty.zip https://gitlab.com/mailman/hyperkitty/repository/archive.zip?ref=master \
|
django-mailman3==1.1.0 \
|
||||||
&& python -m pip install -U mailmanclient.zip \
|
|
||||||
postorius.zip \
|
|
||||||
hyperkitty.zip \
|
|
||||||
whoosh \
|
whoosh \
|
||||||
uwsgi \
|
uwsgi \
|
||||||
psycopg2 \
|
psycopg2 \
|
||||||
dj-database-url \
|
dj-database-url \
|
||||||
pymysql \
|
pymysql \
|
||||||
&& python -m pip install -U django-mailman3.zip \
|
&& python -m pip install -U django==1.10
|
||||||
&& rm mailmanclient.zip postorius.zip hyperkitty.zip django-mailman3.zip
|
|
||||||
|
|
||||||
ADD mailman-web /opt/mailman-web
|
ADD mailman-web /opt/mailman-web
|
||||||
|
|
||||||
@@ -35,4 +31,4 @@ EXPOSE 8000
|
|||||||
|
|
||||||
ENTRYPOINT ["/opt/run.sh"]
|
ENTRYPOINT ["/opt/run.sh"]
|
||||||
|
|
||||||
CMD ["uwsgi", "--http-auto-chunked","--http-keepalive"]
|
CMD ["uwsgi", "--ini", "/opt/mailman-web/uwsgi.ini"]
|
||||||
|
|||||||
@@ -49,8 +49,9 @@ if [[ ! -v DATABASE_URL ]]; then
|
|||||||
echo "DATABASE_URL is not defined. Using sqlite database..."
|
echo "DATABASE_URL is not defined. Using sqlite database..."
|
||||||
export DATABASE_URL=sqlite://mailmanweb.db
|
export DATABASE_URL=sqlite://mailmanweb.db
|
||||||
export DATABASE_TYPE='sqlite'
|
export DATABASE_TYPE='sqlite'
|
||||||
else
|
fi
|
||||||
export DATABASE_TYPE='postgres'
|
|
||||||
|
if [[ "$DATABASE_TYPE" = 'postgres' ]]; then
|
||||||
wait_for_postgres
|
wait_for_postgres
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -88,20 +89,4 @@ python manage.py collectstatic --noinput
|
|||||||
# this command will upgrade the database.
|
# this command will upgrade the database.
|
||||||
python manage.py migrate
|
python manage.py migrate
|
||||||
|
|
||||||
|
|
||||||
# Log to the default location /opt/mailman-web-data/logs/uwsgi.log if the
|
|
||||||
# logging variable is not set.
|
|
||||||
if [[ ! -v UWSGI_LOGTO ]]; then
|
|
||||||
echo "No UWSGI_LOGTO defined, logging uwsgi to /opt/mailman-web-data/logs/uwsgi.log ..."
|
|
||||||
export UWSGI_LOGTO='/opt/mailman-web-data/logs/uwsgi.log'
|
|
||||||
touch "$UWSGI_LOGTO"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ! -v UWSGI_WSGI_FILE ]]; then
|
|
||||||
export UWSGI_WSGI_FILE="wsgi.py"
|
|
||||||
export UWSGI_HTTP=:8000
|
|
||||||
export UWSGI_WORKERS=2
|
|
||||||
export UWSGI_THREADS=4
|
|
||||||
fi
|
|
||||||
|
|
||||||
exec $@
|
exec $@
|
||||||
|
|||||||
10
web/mailman-web/uwsgi.ini
Normal file
10
web/mailman-web/uwsgi.ini
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
[uwsgi]
|
||||||
|
http = :8000
|
||||||
|
chdir = /opt/mailman-web
|
||||||
|
wsgi-file = wsgi.py
|
||||||
|
process = 2
|
||||||
|
threads = 2
|
||||||
|
uid = 1000
|
||||||
|
gid = 1000
|
||||||
|
req-log = file:/opt/mailman-web-data/uwsgi.log
|
||||||
|
error-log = file:/opt/mailman-web-data/uwsgi-error.log
|
||||||
Reference in New Issue
Block a user