feat: Add Docker CI/CD and update docs for Docker usage
Some checks are pending
Docker CI/CD / docker (push) Waiting to run
Some checks are pending
Docker CI/CD / docker (push) Waiting to run
Introduced a new Docker CI/CD workflow to automatically build and push images to Docker Hub on pushes to the 'docker' branch. This automation ensures that the latest version of the bot is readily available for deployment, facilitating easier distribution and deployment for users. The README.md has been updated to improve clarity around installation methods, emphasizing PyPI as the recommended installation method while expanding on Docker usage. It now includes detailed instructions for Docker Hub images, local image building, and Docker Compose deployment, catering to a broader range of users and deployment scenarios. This update aims to make the bot more accessible and manageable by providing clear, step-by-step guidance for different deployment strategies. Related to these changes, the documentation has been restructured to better organize information related to configuration and running the bot, ensuring users have a smoother experience setting up and deploying it in their environment. These changes reflect our commitment to enhancing user experience and streamlining deployment processes, making it easier for users to adopt and maintain the matrix-gptbot in various environments.
This commit is contained in:
parent
f8861a16ad
commit
054f29ea39
2 changed files with 96 additions and 5 deletions
29
.forgejo/workflows/docker-latest.yml
Normal file
29
.forgejo/workflows/docker-latest.yml
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
name: Docker CI/CD
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- 'docker'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
docker:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v3
|
||||||
|
-
|
||||||
|
name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
-
|
||||||
|
name: Login to Docker Hub
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
-
|
||||||
|
name: Build and push
|
||||||
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
push: true
|
||||||
|
tags: kumitterer/matrix-gptbot:latest
|
72
README.md
72
README.md
|
@ -31,7 +31,9 @@ system features.
|
||||||
|
|
||||||
### Production
|
### Production
|
||||||
|
|
||||||
The easiest way to install the bot is to use pip to install it from pypi.
|
#### PyPI
|
||||||
|
|
||||||
|
The recommended way to install the bot is to use pip to install it from PyPI.
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
# If desired, activate a venv first
|
# If desired, activate a venv first
|
||||||
|
@ -50,10 +52,65 @@ for all available features.
|
||||||
You can also use `pip install git+https://git.private.coffee/privatecoffee/matrix-gptbot.git`
|
You can also use `pip install git+https://git.private.coffee/privatecoffee/matrix-gptbot.git`
|
||||||
to install the latest version from the Git repository.
|
to install the latest version from the Git repository.
|
||||||
|
|
||||||
#### Configuration
|
#### Docker
|
||||||
|
|
||||||
The bot requires a configuration file to be present in the working directory.
|
##### From Docker Hub
|
||||||
Copy the provided `config.dist.ini` to `config.ini` and edit it to your needs.
|
|
||||||
|
A Docker image is available on Docker Hub. You can use it to run the bot in a
|
||||||
|
Docker container.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
# Create a config file from the provided example
|
||||||
|
cp config.dist.ini config.ini
|
||||||
|
# Edit the config file to your needs
|
||||||
|
|
||||||
|
# Run the bot
|
||||||
|
docker run -v config.ini:/app/config.ini kumitterer/matrix-gptbot
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Building the image
|
||||||
|
|
||||||
|
Alternatively, you can use the provided `Dockerfile` to build and run the bot
|
||||||
|
locally.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
# Clone the repository
|
||||||
|
git clone https://git.private.coffee/privatecoffee/matrix-gptbot.git
|
||||||
|
cd matrix-gptbot
|
||||||
|
|
||||||
|
# Build the Docker image
|
||||||
|
docker build -t matrix-gptbot .
|
||||||
|
|
||||||
|
# Create a config file
|
||||||
|
cp config.dist.ini config.ini
|
||||||
|
# Edit the config file to your needs
|
||||||
|
|
||||||
|
# Run the bot
|
||||||
|
docker run -v config.ini:/app/config.ini matrix-gptbot
|
||||||
|
```
|
||||||
|
|
||||||
|
##### Docker Compose
|
||||||
|
|
||||||
|
A `docker-compose.yml` file is provided that you can use to run the bot with
|
||||||
|
Docker Compose. You will need to create a `config.ini` file as described above.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
# Clone the repository
|
||||||
|
git clone https://git.private.coffee/privatecoffee/matrix-gptbot.git
|
||||||
|
cd matrix-gptbot
|
||||||
|
|
||||||
|
# Create a config file
|
||||||
|
cp config.dist.ini config.ini
|
||||||
|
# Edit the config file to your needs
|
||||||
|
|
||||||
|
# Optionally, create Pantalaimon config
|
||||||
|
cp pantalaimon.example.conf pantalaimon.conf
|
||||||
|
# Edit the Pantalaimon config file to your needs
|
||||||
|
# Don't forget to update config.ini to point to your Pantalaimon instance
|
||||||
|
|
||||||
|
# Start the bot
|
||||||
|
docker-compose up -d
|
||||||
|
```
|
||||||
|
|
||||||
#### End-to-end encryption
|
#### End-to-end encryption
|
||||||
|
|
||||||
|
@ -115,7 +172,12 @@ before merging.
|
||||||
|
|
||||||
## Running
|
## Running
|
||||||
|
|
||||||
The bot can be run with `python -m gptbot`. If required, activate a venv first.
|
The bot requires a configuration file to be present in the working directory.
|
||||||
|
|
||||||
|
Copy the provided `config.dist.ini` to `config.ini` and edit it to your needs.
|
||||||
|
|
||||||
|
The bot can then be run with `python -m gptbot`. If required, activate a venv
|
||||||
|
first.
|
||||||
|
|
||||||
You may want to run the bot in a screen or tmux session, or use a process
|
You may want to run the bot in a screen or tmux session, or use a process
|
||||||
manager like systemd. The repository contains a sample systemd service file
|
manager like systemd. The repository contains a sample systemd service file
|
||||||
|
|
Loading…
Reference in a new issue