You need Python 3.12 and mysqlclient build dependencies installed.
Ubuntu:
sudo apt-get install build-essential pkg-config default-libmysqlclient-dev
macOS:
brew install mysql-client pkg-config
export PATH="$(brew --prefix mysql-client)/bin:$PATH"
export PKG_CONFIG_PATH="$(brew --prefix mysql-client)/lib/pkgconfig"
cd /path/to/projectpython3.12 -m venv .venvsource .venv/bin/activatepython -m pip install --upgrade pippython -m pip install -r requirements.txtexport TELEGRAM_TOKEN=...export OWNER_TELEGRAM_ID=...export DB_HOST=127.0.0.1export DB_NAME=fatbotexport DB_USER=fatbotexport DB_PASSWORD=fatbotalembic upgrade headpython fatbot.py
cp .env.example .envnano .envdocker compose up --build app
Useful database shell:
docker compose exec mysql mysql -uroot -prootCREATE USER 'fatbot'@'192.168.%' IDENTIFIED BY 'fatbot';GRANT ALL ON fatbot.* to fatbot@'192.168.%';
alembic revision -m "revisionname"
alembic upgrade head
alembic downgrade -1
python3.12 -m venv .venvsource .venv/bin/activatepython -m pip install --upgrade pippython -m pip install -r requirements-dev.txtalembic upgrade headpytest
cp .env.example .envnano .envsudo cp fatbot.service.example /etc/systemd/system/fatbot.servicesudo nano /etc/systemd/system/fatbot.servicesudo systemctl daemon-reloadsudo systemctl start fatbotsudo systemctl enable fatbotsudo visudo- add
yakninja ALL=(ALL:ALL) NOPASSWD: /bin/systemctl start fatbot, /bin/systemctl stop fatbot, /bin/systemctl restart fatbot - see logs with
journalctl -f -u fatbot