Self Hosting
These are general instructions to self host the bot.
Clone the repository with git
git clone https://gitlab.com/lightning-bot/Lightning.git
- Install docker & docker compose
- Docker Compose (If you are on macOS or Windows, compose already comes with Docker. You shouldn't need to install it again.)
- Configure the bot
- Copy
example-config.toml
and rename the copy toconfig.toml
- Run the bot
docker-compose up
docker-compose down
stops the containersdocker-compose up -d
to run the containers in "detached" mode. This will free up the current terminal session.docker-compose --help
gives you help
- Install Python 3.8+
- Install poetryFollow the instructions at https://python-poetry.org/docs/ to install poetry on your system.
- Install the dependencies
poetry install --no-dev
- Create the database in PostgreSQL
You will need PostgreSQL installed. Type the following in the
psql
toolCREATE ROLE lightningbot WITH LOGIN PASSWORD 'somepasswordtoset';
CREATE DATABASE lightning OWNER lightningbot;
- Configure the bot & setup the database tables
- Configure the
example-config.toml
file and rename it toconfig.toml
- Run
poetry run lightning db upgrade
to initialize the database.
- Activate the venv and run the bot
- Run
poetry run lightning
. Alternatively, you can dopoetry run python3 -m lightning
The bot makes use of a folder called
config
which contains files that are used within the bot.Run
poetry run lightning db upgrade
to run migrations!If you want to view what migrations are applied and aren't, run
poetry run lightning db log
Last modified 4mo ago