Compare commits

..

12 Commits

Author SHA1 Message Date
d674867968 add networking 2023-11-03 20:07:55 +00:00
5e53aacaae fix poise dependency 2023-11-03 19:53:50 +00:00
6313a7d3e5 template desc 2023-11-03 19:52:27 +00:00
c1ddeaf485 remove invalid rustflag 2023-11-03 19:51:09 +00:00
7bea919bd4 templating 2023-11-03 19:44:36 +00:00
5eaafa923c add more templated files 2023-11-03 19:41:22 +00:00
dd530199b2 add templating 2023-11-03 19:39:59 +00:00
268cb5ee0a Add dockerfile 2023-11-03 19:39:12 +00:00
a218eb606b remove dumb templating 2023-11-02 23:39:46 -06:00
6705a83880 fix repo link 2023-11-02 23:37:41 -06:00
b8033d1d12 adding templating 2023-11-02 23:34:49 -06:00
bfa00a924f semi-added docker support. added templating 2023-11-02 23:33:11 -06:00
5 changed files with 59 additions and 4 deletions

5
.gitea/template Normal file
View File

@@ -0,0 +1,5 @@
# Use template filling in these files:
docker-compose.yaml
Dockerfile
Cargo.toml
README.md

View File

@@ -1,5 +1,8 @@
[package] [package]
name = "discord-word-counter" name = "${REPO-NAME}"
authors = ["${REPO_OWNER}", "${TEMPLATE_OWNER}"]
description = "${REPO_DESCRIPTION}"
repository = "${REPO_HTTPS_URL}"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2021"
@@ -8,7 +11,7 @@ edition = "2021"
[dependencies] [dependencies]
tokio = { version = "1.21.2", features = ["macros", "rt-multi-thread"] } tokio = { version = "1.21.2", features = ["macros", "rt-multi-thread"] }
# songbird = { version = "0.3.2", features = ["yt-dlp"] } # songbird = { version = "0.3.2", features = ["yt-dlp"] }
poise = { path = "../poise/", features = ["cache"] } poise = { version = "0.5.7", features = ["cache"] }
dotenv = "0.15.0" dotenv = "0.15.0"
anyhow = "1.0.75" anyhow = "1.0.75"
url = "2.4.1" url = "2.4.1"

17
Dockerfile Normal file
View File

@@ -0,0 +1,17 @@
# Build the execuitible
FROM rustlang/rust:nightly as builder
ENV RUSTFLAGS=""
WORKDIR /bot
# RUN apt-get update && apt-get upgrade -y
COPY . .
RUN cargo build --release
# Now make the runtime container
FROM debian:bookworm-slim
RUN apt-get update && apt-get upgrade -y && apt-get clean
COPY --from=builder /bot/target/release/${REPO-NAME} /usr/local/bin/${REPO-NAME}
COPY Cargo.lock /
CMD ["/usr/local/bin/${REPO-NAME}"]

View File

@@ -1,6 +1,6 @@
# discord-bot-template # ${REPO_NAME}
A quick rust-based discord bot template. ${REPO_DESCRIPTION}
## Getting started ## Getting started
* goto: [Discord applicatoins](https://discord.com/developers/applications) and * goto: [Discord applicatoins](https://discord.com/developers/applications) and

30
docker-compose.yaml Normal file
View File

@@ -0,0 +1,30 @@
version: '3.1'
name: ${REPO_NAME}
services:
bot:
container_name: ${REPO_NAME}_bot
build: ${REPO_HTTPS_URL}
restart: always
environment:
# These will read from the .env file
DISCORD_INTENTS: $${DISCORD_INTENTS}
DISCORD_TOKEN: $${DISCORD_TOKEN}
DISCORD_ID: $${DISCORD_ID}
networks:
- external
- internal
redis:
container_name: ${REPO_NAME}_redis
image: redis
restart: always
ports:
- 6379:6379
networks:
- internal
networks:
internal:
driver: bridge
internal: true
external:
driver: bridge