diff --git a/DEPLOYMENT.md b/DEPLOYMENT.md deleted file mode 100644 index 79b44aa..0000000 --- a/DEPLOYMENT.md +++ /dev/null @@ -1,73 +0,0 @@ -### Initial Setup - -See [here](https://www.digitalocean.com/community/tutorials/how-to-serve-flask-applications-with-uswgi-and-nginx-on-ubuntu-18-04) for initial server setup. - -Create the directories: - -``` -sudo mkdir -p /var/app/decidel -sudo chown -R $USER:$USER /var/app/decidel -sudo mkdir -p /var/log/decidel -sudo chown -R $USER:$USER /var/log/decidel -``` - -Create `/etc/systemd/system/decidel.service` to run the app under supervision: - -``` -[Unit] -Description=uWSGI instance to serve decidel -After=network.target - -[Service] -User= -Group=www-data -WorkingDirectory=/var/app/decidel -Environment="PATH=/var/app/decidel/venv/bin" -ExecStart=/var/app/decidel/venv/bin/uwsgi --ini decidel.ini - -[Install] -WantedBy=multi-user.target -``` - -Start the service and set it to run on boot: - -``` -sudo systemctl start decidel -sudo systemctl enable decidel -``` - -Setup nginx directive: - -``` -# /etc/nginx/sites-available/api.decidel.ca - -server { - - # ssl directives - ... - - - server_name api.decidel.ca; - - location / { - include uwsgi_params; - uwsgi_pass unix:/var/app/decidel/decidel.sock; - } -} -``` - -``` -sudo ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/ -sudo systemctl restart nginx -``` - -Install redis: - -* https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-redis-on-ubuntu-18-04 -* https://www.digitalocean.com/community/tutorials/how-to-back-up-and-restore-your-redis-data-on-ubuntu-14-04 - -Make sure `REDIS_URL` is set correctly in /var/app/decidel/instance/config.py - -### Deploying updates - -Actual deployment is handled by the [Deploy Action](.github/workflows/deploy.yml). diff --git a/README.md b/README.md index 8910e7b..15b7e17 100644 --- a/README.md +++ b/README.md @@ -36,4 +36,10 @@ Make sure redis is installed FLASK_APP=decidel FLASK_ENV=development flask run ``` +### Deployment + +See [these instructions](https://development-recipes.readthedocs.io/en/latest/hosting.html) for initial setup. + +Actual deployment is handled by the [Deploy Action](.github/workflows/deploy.yml). + ![](https://github.com/jpmunz/decidel-flask/workflows/Build%20and%20Deploy/badge.svg)