-
Notifications
You must be signed in to change notification settings - Fork 4
Production Deployment Guide
This document will guide you through the process of deploying GoobyDesk for production use on a VPS. This has been tested on Linode and Oracle OCI.
I will not be providing security or basic setup guidance. Your VPS maintenance is on you.
sudo mkdir /your/desired/path
sudo chown caddy /your/desired/path
cd /your/desired/path
git clone https://github.com/GoobyFRS/GoobyDesk.git
cd /var/www/GoobyDesk
cp example-env .env
cp example-employee.json employee.json
cp example-tickets.json tickets.json
touch goobyDesk.log
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
BEFORE YOU CONTINUE FORWARD YOU SHOULD ASSIGN CORRECT VARIABLE IN THE DOTENV (.env) FILE AND UPDATE employee.json WITH THE DESIRED LOGIN CREDENTIALS
RUN THE APPLICATION AS IS TO ENSURE NO ERRORS APPEAR IN THE TERMINAL python3 ./app.py
CTRL+C to quit.
VALIDATE GUNICORN WORKS gunicorn --bind 127.0.0.1:8000 app:app
CTRL+C to quit.
NOW YOU MAY CONTINUE
Create a systemd service for Gunicorn. By default Gunicorn will use port 8000.
sudo touch /etc/systemd/system/goobydesk.service
Add the following content.
[Unit]
Description=Gunicorn Instance serving GoobyDesk
After=network.target
[Service]
User=yourUsername
Group=www-data
WorkingDirectory=/your/desired/path/GoobyDesk
Environment="PATH=/your/desired/path/GoobyDesk/venv/bin"
ExecStart=/your/desired/path/GoobyDesk/venv/bin/gunicorn -w 3 -b 127.0.0.1:8000 app:app
[Install]
WantedBy=multi-user.target
Append the following to your Caddyfile.
subdomain.example.org {
reverse_proxy 127.0.0.1:8000
log {
output file /var/log/caddy/access.log
format json
}
}
After creating the Caddy file with logging, setup a log rotation config for the Caddy logs....
sudo nano /etc/logrotate.d/caddy
Append the following data to the caddy log rotation config...
/var/log/caddy/access.log {
size 10M
rotate 12
compress
missingok
notifempty
copytruncate
}
sudo systemctl status goobydesk.service
sudo systemctl stop goobydesk.service
sudo systemctl start goobydesk.service
sudo systemctl restart goobydesk.service
/your/desired/path/GoobyDesk
sudo systemctl stop goobydesk.service
git pull origin main
sudo systemctl start goobydesk.service
sudo systemctl status goobydesk.service