Repository navigation
Install
Lajos Santa edited this page Feb 3, 2021
·
23 revisions
- python v3.9
- virtualenv (optional, but recommended)
- postgresql (and create user, db, etc..)
- redis
sudo pip install virtualenv- pick some folder for the virtualenv's files (eg /var/www/buck)
virtualenv /var/www/bucksource /var/www/buck/bin/activate
-
TODO(at this moment: clone this repo, build, copy the dist to the target system, and install) - put the example config to
/etc/buck.yaml - update database:
cd /var/www/buck/lib/python3.9/site-packages/buck
alembic upgrade head- test the install:
uvicorn buck.app:app --host 0.0.0.0 --port 9000
- make writable
/var/www/buck/by the www-data user (chown www-data /var/www/buck/)
- create systemd service file
/etc/systemd/system/buck-web.servicewith this content:
[Unit]
Description=Buck web service
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=always
RestartSec=1
User=www-data
Environment=BUCK_CONFIG_FILE=/etc/buck.yaml
ExecStart=/var/www/buck/bin/uvicorn buck.app:app --workers 4 --port 9000
[Install]
WantedBy=multi-user.target
- start:
systemctl start buck-web - automatically get it to start on boot
systemctl enable buck-web - Follow logs:
journalctl -u buck-web.service -f
- create systemd service file
/etc/systemd/system/buck-celery.servicewith this content:
[Unit]
Description=Buck celery service
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=always
RestartSec=1
User=www-data
Environment=BUCK_CONFIG_FILE=/etc/buck.yaml
ExecStart=/var/www/buck/bin/celery -A buck.celery.app worker --loglevel=info --statedb=/var/www/buck/celery.state
[Install]
WantedBy=multi-user.target