From 78ebd3a9c3803910e6be9f9d797bca7e8d03987e Mon Sep 17 00:00:00 2001 From: klingelschmidt Date: Sat, 7 Feb 2026 22:17:05 +0100 Subject: [PATCH 1/6] Add dockerfile --- Dockerfile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7bf9295 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +# Build stage +FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build +WORKDIR /src + +COPY SupportBoi.csproj . +COPY lib/ lib/ +RUN dotnet restore -r linux-x64 + +COPY . . +RUN dotnet publish -c Release -r linux-x64 --self-contained -o /app --no-restore + +# Runtime image +FROM mcr.microsoft.com/dotnet/runtime-deps:9.0 +WORKDIR /app + +COPY --from=build /app . + +ENTRYPOINT ["./supportboi"] From 04bba0efbbabf632491d4c06bc6f68e539b37cf6 Mon Sep 17 00:00:00 2001 From: JV <60178327+klingelschmidt@users.noreply.github.com> Date: Sat, 7 Feb 2026 23:11:04 +0100 Subject: [PATCH 2/6] Add instructions for docker --- docs/Installation.md | 85 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/docs/Installation.md b/docs/Installation.md index 966d1e1..b13b2f8 100644 --- a/docs/Installation.md +++ b/docs/Installation.md @@ -175,6 +175,91 @@ While the Windows versions are fully supported they are not as well tested as th +> [!WARNING] +> Only advanced users beyond this point. + +
+Docker +
+ +Until Karl uploads a container image on Dockerhub you need to build the container yourself. + +**1.** In the main directory you can build the container image with +```bash +sudo docker build -t supportboi:latest . +``` + +**2.** Create a compose.yaml that will start a database and supportboi. For example: +```yaml +services: + supportboi: + image: supportboi:latest + restart: unless-stopped + command: + - --config + - /app/config.yml + - --transcripts + - /app/transcripts + - --log-file + - /app/supportboi.log + volumes: + - ./config.yml:/app/config.yml:ro + - ./transcripts:/app/transcripts + - ./supportboi.log:/app/supportboi.log:rw + depends_on: + db: + condition: service_healthy + + supportboi-db: + image: mariadb:11 + restart: unless-stopped + environment: + MARIADB_ROOT_PASSWORD: ${DB_ROOT_PASSWORD:?required} + MARIADB_DATABASE: supportboi + MARIADB_USER: supportboi + MARIADB_PASSWORD: ${DB_PASSWORD:?required} + volumes: + - db_data:/var/lib/mysql + healthcheck: + test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"] + interval: 10s + timeout: 5s + retries: 5 + +volumes: + db_data: +``` + +**3.** Set up the config.yml file + +```bash +curl -so config.yml https://raw.githubusercontent.com/KarlOfDuty/SupportBoi/refs/heads/main/default_config.yml +``` + +Change the database address to the database container name. + +```yaml +database: + # Address and port of the mysql server. + address: "supportboi-db" + port: 3306 +``` + +**4.** Run the compose file + +Create a .env file with database passwords. +``` +DB_ROOT_PASSWORD= +DB_PASSWORD= +``` + +Start the compose file +``` +sudo docker compose up -d --env-file .env +``` + +
+ # Database Setup This guide assumes a MySQL/MariaDB installation, but it will be the same with other compatible database servers. From a9dd9e8585c5090aed8221f33d24baf6235bb3a8 Mon Sep 17 00:00:00 2001 From: JV <60178327+klingelschmidt@users.noreply.github.com> Date: Sat, 7 Feb 2026 23:30:46 +0100 Subject: [PATCH 3/6] update installation --- docs/Installation.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/Installation.md b/docs/Installation.md index b13b2f8..3093305 100644 --- a/docs/Installation.md +++ b/docs/Installation.md @@ -253,6 +253,12 @@ DB_ROOT_PASSWORD= DB_PASSWORD= ``` +Create the logfile before starting or docker will create it as a directory + +```bash +touch supportboi.log +``` + Start the compose file ``` sudo docker compose up -d --env-file .env From 6157a84a349ed79199a59ce0c0df46a202e5f1fe Mon Sep 17 00:00:00 2001 From: JV <60178327+klingelschmidt@users.noreply.github.com> Date: Sun, 8 Feb 2026 17:56:40 +0100 Subject: [PATCH 4/6] Update docker instructions --- docs/Installation.md | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/docs/Installation.md b/docs/Installation.md index 3093305..f730950 100644 --- a/docs/Installation.md +++ b/docs/Installation.md @@ -195,19 +195,12 @@ services: supportboi: image: supportboi:latest restart: unless-stopped - command: - - --config - - /app/config.yml - - --transcripts - - /app/transcripts - - --log-file - - /app/supportboi.log volumes: - ./config.yml:/app/config.yml:ro - ./transcripts:/app/transcripts - - ./supportboi.log:/app/supportboi.log:rw + - ./supportboi.log:/app/supportboi.log depends_on: - db: + supportboi-db: condition: service_healthy supportboi-db: @@ -235,8 +228,9 @@ volumes: ```bash curl -so config.yml https://raw.githubusercontent.com/KarlOfDuty/SupportBoi/refs/heads/main/default_config.yml ``` +Open the bot config using your preferred text editor and set it up to your liking. It contains instructions for all options -Change the database address to the database container name. +If you are starting the database and supportbot with the same compose file you can change the database address to the database container name. ```yaml database: @@ -245,15 +239,20 @@ database: port: 3306 ``` -**4.** Run the compose file +Set the log file and transcript dir to the paths in the compose file. -Create a .env file with database passwords. -``` -DB_ROOT_PASSWORD= -DB_PASSWORD= +Example for using the compose file above: + +```yaml + transcript-dir: "/app/transcripts" + log-file: "/app/supportboi.log" ``` -Create the logfile before starting or docker will create it as a directory +**4.** Run the compose file + +Make sure any env vars that are needed for the database are sourced before starting! + +Create the logfile before starting or docker will create a directory ```bash touch supportboi.log @@ -261,7 +260,7 @@ touch supportboi.log Start the compose file ``` -sudo docker compose up -d --env-file .env +sudo docker compose up -d ``` From 579dce22ffd5f3a34c58dd0fafdbc38f6799f842 Mon Sep 17 00:00:00 2001 From: klingelschmidt Date: Sun, 8 Feb 2026 20:44:31 +0100 Subject: [PATCH 5/6] Sample compose file --- compose.yaml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 compose.yaml diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 0000000..f7e5a6e --- /dev/null +++ b/compose.yaml @@ -0,0 +1,30 @@ +services: + supportboi: + image: supportboi:latest + restart: unless-stopped + volumes: + - ./config.yml:/app/config.yml:ro + - ./transcripts:/app/transcripts + - ./logs:/app/log + depends_on: + supportboi-db: + condition: service_healthy + + supportboi-db: + image: mariadb:11 + restart: unless-stopped + environment: + MARIADB_ROOT_PASSWORD: ${DB_ROOT_PASSWORD:?required} + MARIADB_DATABASE: supportboi + MARIADB_USER: supportboi + MARIADB_PASSWORD: ${DB_PASSWORD:?required} + volumes: + - db_data:/var/lib/mysql + healthcheck: + test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"] + interval: 10s + timeout: 5s + retries: 5 + +volumes: + db_data: From 9981fd2c116978f844ac75252e38d67a9930e39d Mon Sep 17 00:00:00 2001 From: JV <60178327+klingelschmidt@users.noreply.github.com> Date: Sun, 8 Feb 2026 20:56:07 +0100 Subject: [PATCH 6/6] Update docker install steps --- docs/Installation.md | 63 ++++++++++---------------------------------- 1 file changed, 14 insertions(+), 49 deletions(-) diff --git a/docs/Installation.md b/docs/Installation.md index f730950..1dceb38 100644 --- a/docs/Installation.md +++ b/docs/Installation.md @@ -182,55 +182,27 @@ While the Windows versions are fully supported they are not as well tested as th Docker
-Until Karl uploads a container image on Dockerhub you need to build the container yourself. +Until Karl uploads an official container image you need to build the container yourself. + +**0.** In the main directory you can build the container image with -**1.** In the main directory you can build the container image with ```bash sudo docker build -t supportboi:latest . ``` -**2.** Create a compose.yaml that will start a database and supportboi. For example: -```yaml -services: - supportboi: - image: supportboi:latest - restart: unless-stopped - volumes: - - ./config.yml:/app/config.yml:ro - - ./transcripts:/app/transcripts - - ./supportboi.log:/app/supportboi.log - depends_on: - supportboi-db: - condition: service_healthy - - supportboi-db: - image: mariadb:11 - restart: unless-stopped - environment: - MARIADB_ROOT_PASSWORD: ${DB_ROOT_PASSWORD:?required} - MARIADB_DATABASE: supportboi - MARIADB_USER: supportboi - MARIADB_PASSWORD: ${DB_PASSWORD:?required} - volumes: - - db_data:/var/lib/mysql - healthcheck: - test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"] - interval: 10s - timeout: 5s - retries: 5 - -volumes: - db_data: -``` +**1.** Create a compose file -**3.** Set up the config.yml file +You can use compose.yaml in the main repo as a reference. + +**2.** Set up the config.yml file ```bash curl -so config.yml https://raw.githubusercontent.com/KarlOfDuty/SupportBoi/refs/heads/main/default_config.yml ``` + Open the bot config using your preferred text editor and set it up to your liking. It contains instructions for all options -If you are starting the database and supportbot with the same compose file you can change the database address to the database container name. +If you are defining the bot and database in the same file you can set the database address to the database container name. ```yaml database: @@ -239,26 +211,19 @@ database: port: 3306 ``` -Set the log file and transcript dir to the paths in the compose file. - -Example for using the compose file above: +Set the log file and transcript dir to bind mounts so you can reach them on the host system. ```yaml transcript-dir: "/app/transcripts" - log-file: "/app/supportboi.log" + log-file: "/app/log/supportboi.log" ``` -**4.** Run the compose file - -Make sure any env vars that are needed for the database are sourced before starting! +**3.** Run the compose file -Create the logfile before starting or docker will create a directory +If you are using the example compose.yaml you need to source the database passwords that will be used to create the database! -```bash -touch supportboi.log -``` +Start the bot and database: -Start the compose file ``` sudo docker compose up -d ```