add gunicorn and deployment files

This commit is contained in:
j 2017-12-19 10:47:06 +01:00
parent f2cd78e316
commit 2f1914c3db
4 changed files with 69 additions and 0 deletions

View File

@ -0,0 +1,42 @@
<VirtualHost *:80>
ServerName studio.camp
Redirect / https://studio.camp/
</VirtualHost>
<VirtualHost *:443>
SSLCertificateFile /etc/letsencrypt/studio.camp/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/studio.camp/key.pem
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateChainFile /etc/letsencrypt/studio.camp/chain.pem
ServerName studio.camp
<Location />
Options -Indexes
</Location>
<Directory /srv/camp>
Order deny,allow
Allow from all
</Directory>
Alias /static /srv/camp/static
Alias /images /srv/camp/data/images
LogLevel warn
ErrorLog /var/log/apache2/studio.camp.error.log
CustomLog /var/log/apache2/studio.camp.log combined
ServerSignature Off
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass /static !
ProxyPass /images !
RequestHeader unset Proxy
ProxyPass / http://127.0.0.1:8087/
ProxyPassReverse / http://127.0.0.1:8087/
</VirtualHost>

12
etc/init/camp.conf Normal file
View File

@ -0,0 +1,12 @@
start on (filesystem and net-device-up IFACE=lo)
stop on runlevel [!2345]
# give time to send info to trackers
kill timeout 30
setuid campdjango
setgid campdjango
respawn
chdir /srv/camp
exec /srv/camp/venv/bin/gunicorn -b 127.0.0.1:8087 camp.wsgi:application

View File

@ -0,0 +1,14 @@
[Unit]
Description=studio.camp
After=postgresql.service
[Service]
Type=simple
Restart=always
User=campdjango
Group=campdjango
WorkingDirectory=/srv/camp
ExeccStart=/srv/camp/venv/bin/gunicorn -b 127.0.0.1:8087 camp.wsgi:application
[Install]
WantedBy=multi-user.target

View File

@ -4,3 +4,4 @@ django-photologue
django-braces
django-app-namespace-template-loader
ox
gunicorn