Commit ccdd53e5 authored by Luís de Sousa's avatar Luís de Sousa
Browse files

Correcting launching processes in startup script.

parent 2dc13455
# Create socket for Gunicorn
touch /var/www/
chown www-data:www-data /var/www/
# Launch Gunicorn
exec /usr/local/bin/gunicorn wsgi:app \
--workers 3 \
--bind \
-m 007
cd /var/www/
mkdir logs
echo "Launching Gunicorn..."
nohup /usr/local/bin/gunicorn wsgi:app --workers 3 --bind -m 007 </dev/null >logs/gunicorn.log 2>&1 &
# Remove default site from nginx
echo "Setting up nginx config."
rm /etc/nginx/sites-enabled/default
cp /var/www/ /etc/nginx/sites-enabled/
echo "Launching nginx..."
nohup nginx </dev/null >logs/nginx.log 2>&1 &
# Launch neginx
exec nginx
# Wait a little for Gunicorn to set up
sleep 2
echo "Fixing access to socket."
chown www-data:www-data /var/www/
echo "All done. Good to go!"
Supports Markdown
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