-
Notifications
You must be signed in to change notification settings - Fork 3
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 /var/www/GoobyDesk
sudo chown caddy /var/www/GoobyDesk
cd /var/www/GoobyDesk
git clone https://github.com/GoobyFRS/GoobyDesk.git
cp example_env .env
cp example_employee.json employee.json
cp example_tickets.json tickets.json
touch /var/log/goobydesk.log
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txtBEFORE YOU CONTINUE FORWARD YOU SHOULD ASSIGN CORRECT VARIABLE IN THE DOTENV (.env) FILE, UPDATE employee.json WITH THE DESIRED LOGIN CREDENTIALS, AND VERIFY THE CONTENT OF THE CORE_CONFIGURATION.YML FILE
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:appCTRL+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=/var/www/GoobyDesk
Environment="PATH=/var/www/GoobyDesk/venv/bin"
ExecStart=/var/www/GoobyDesk/venv/bin/gunicorn -w 3 -b 127.0.0.1:8000 app:app
[Install]
WantedBy=multi-user.targetAppend 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/caddyAppend 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.servicesudo systemctl stop goobydesk.servicesudo systemctl start goobydesk.servicesudo systemctl restart goobydesk.servicetail -n 25 /var/log/goobydesk.log
/your/desired/path/GoobyDesk
sudo systemctl stop goobydesk.service
git pull origin main
sudo systemctl start goobydesk.service
sudo systemctl status goobydesk.service