mirror of
https://github.com/peeringdb/peeringdb.git
synced 2024-05-11 05:55:09 +00:00
containerize, gh-548 (#682)
This commit is contained in:
29
Ctl/docker/django-uwsgi.ini
Normal file
29
Ctl/docker/django-uwsgi.ini
Normal file
@@ -0,0 +1,29 @@
|
||||
[uwsgi]
|
||||
# project base dir
|
||||
chdir=/srv/www.peeringdb.com
|
||||
# wsgi app to run
|
||||
module=mainsite.wsgi
|
||||
# virtualenv
|
||||
home=/srv/www.peeringdb.com/venv
|
||||
|
||||
# should be set from environment variable UWSGI_SOCKET
|
||||
# socket=127.0.0.1:7002
|
||||
|
||||
#logger=syslog:uwsgi.pdb,local0
|
||||
# headers only
|
||||
|
||||
# see nginx.conf's "large_client_header_buffers" for details
|
||||
# (uwsgi protocol max is 65535)
|
||||
buffer-size=65535
|
||||
|
||||
#enable-threads=true
|
||||
#threads=5
|
||||
|
||||
master=true
|
||||
processes=20
|
||||
max-requests=1000
|
||||
# terminate request after 60 seconds
|
||||
harakiri=60
|
||||
|
||||
# systemd conformance
|
||||
die-on-term = true
|
||||
37
Ctl/docker/entrypoint.sh
Executable file
37
Ctl/docker/entrypoint.sh
Executable file
@@ -0,0 +1,37 @@
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
if [[ "$PDB_NO_MIGRATE" == "" ]]; then
|
||||
echo applying migrations - django_peeringdb
|
||||
# always fake, since peeeringdb_server does not use concrete models
|
||||
manage migrate django_peeringdb --fake
|
||||
echo applying all migrations
|
||||
manage migrate
|
||||
fi
|
||||
|
||||
|
||||
cd /srv/www.peeringdb.com
|
||||
|
||||
case "$1" in
|
||||
"uwsgi" )
|
||||
echo starting uwsgi
|
||||
exec venv/bin/uwsgi --ini etc/django-uwsgi.ini
|
||||
;;
|
||||
"inetd" )
|
||||
inetd -f -e -q 1024
|
||||
;;
|
||||
"in.whois" )
|
||||
exec ./in.whoisd
|
||||
;;
|
||||
"whois" )
|
||||
line=$(head -1 | tr -cd '[:alnum:]._-')
|
||||
exec manage pdb_whois "$line"
|
||||
;;
|
||||
"/bin/sh" )
|
||||
echo dropping to shell
|
||||
exec /bin/sh
|
||||
;;
|
||||
* )
|
||||
exec manage $@
|
||||
;;
|
||||
esac
|
||||
1
Ctl/docker/inetd.conf
Normal file
1
Ctl/docker/inetd.conf
Normal file
@@ -0,0 +1 @@
|
||||
whois stream tcp nowait pdb /srv/www.peeringdb.com/in.whoisd
|
||||
Reference in New Issue
Block a user