Updated docker commands, docs

This commit is contained in:
Benjamin Sherriff
2024-03-03 16:17:56 -05:00
parent aebc3516b1
commit 39d9850c41
6 changed files with 35 additions and 13 deletions

View File

@@ -8,6 +8,12 @@ Siren is a D&D Bot built for Discord, written in Rust. Features include:
- Assistant DM tools to be defined later
## Running
1. Setup the Discord Developer Application and bot
2. Copy `.env.TEMPLATE` to `.env` and fill out the fields
3. Build the [Docker](https://www.docker.com/) application with `make build`
4. Start the application with `make up`
### Setting up the Discord Developer Application
Visit the [Discord Developer Portal](https://discord.com/developers/applications) and create a new application. Click [here](https://discord.com/developers/docs/intro) for guides and more information.
Required Scopes:
@@ -20,9 +26,9 @@ https://discord.com/api/oauth2/authorize?client_id=<CLIENT_ID>&permissions=40671
```
The CLIENT_ID can be found in the General Information tab on the Discord Developer Portal for your application, under `Application ID`
1. Copy `.env.TEMPLATE` to `.env` and fill out the fields
2. Build the [Docker](https://www.docker.com/) application with `make build`
3. Start the application with `make up`
The DISCORD_TOKEN (used in the `.env file`) can be found under the Bot tab on the Discord Developer Portal for your application.
![DISCORD_TOKEN Example](docs/discord_token_example.png)
## Contributing
[Rust](https://www.rust-lang.org/) must be installed to run locally. See [serenity-rs/serenity](https://github.com/serenity-rs/serenity) for more information about Rust Discord API Library.
@@ -61,8 +67,10 @@ The following packages must be installed for [serenity-rs/songbird](https://gith
```
</details>
Begin the application with `cargo run` (note the database must still be running)
- `docker compose up -d db`
### Running Locally
1. Build the [Docker](https://www.docker.com/) containers with `make build`
2. Start the utility containers with `make utils`
3. Start the application with `cargo run`
The application can also be tested from within a Docker container:
```

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

View File

@@ -1,7 +1,7 @@
RUST_LOG=warn,service=info
DATABASE_USER=siren
DATABASE_PASSWORD=
DATABASE_PASSWORD= #Required
DATABASE_NAME=siren
DATABASE_HOST=localhost
DATABASE_PORT=5432
@@ -10,7 +10,7 @@ KEYS_DIR_PATH=
SESSION_TTL=1440
MINIO_ROOT_USER=siren
MINIO_ROOT_PASSWORD=
MINIO_ROOT_PASSWORD= #Required
MINIO_HOST=localhost
MINIO_PORT=9000
MINIO_PORT_INTERNAL=9001
@@ -22,6 +22,6 @@ SERVICE_HOST=localhost
SERVICE_PORT=5000
DATA_DIR_PATH=
DISCORD_TOKEN=
DISCORD_TOKEN= #Required
OPENAI_API_KEY=
OPENAI_API_MODEL=gpt-3.5-turbo

View File

@@ -13,10 +13,11 @@ help: ## Help command
build: ## Build the docker image
docker compose build
utils: ## Start the utils
docker compose up -d db
docker compose up -d redis
docker compose up -d minio
backend-up: ## Start the backend containers
docker compose --profile backend up -d
backend-down: ## Stop the backend containers
docker compose --profile backend down
up: ## Start the app
docker compose up -d
@@ -24,7 +25,7 @@ up: ## Start the app
down: ## Stop the app
docker compose down
clean:
clean: ## Clean the app
docker compose down && \
docker image rm siren-service || \
docker network rm siren_frontend || \

View File

@@ -37,6 +37,9 @@ services:
- frontend
- backend
restart: unless-stopped
profiles:
- siren
db:
image: postgres:latest
container_name: siren-db
@@ -53,6 +56,9 @@ services:
networks:
- backend
restart: unless-stopped
profiles:
- backend
redis:
image: redis:latest
container_name: siren-redis
@@ -63,6 +69,9 @@ services:
networks:
- backend
restart: unless-stopped
profiles:
- backend
minio:
image: minio/minio
container_name: siren-minio
@@ -78,6 +87,8 @@ services:
- backend
command: server --console-address ":9001" /data
restart: unless-stopped
profiles:
- backend
volumes:
db:

View File

@@ -21,6 +21,8 @@ services:
networks:
- siren-frontend
restart: unless-stopped
profiles:
- frontend
networks:
siren-frontend: {}