Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docker compose #23

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ API_ENDPOINT=default
MODEL=gpt-3.5-turbo
DEBUG=false
UWU=true
SYSTEM_MESSAGE=`You're ChatGPT Discord Bot. Answer as concisely as possible for each response.`
SYSTEM_MESSAGE=`You're ChatGPT Discord Bot. Answer as concisely as possible for each response.`
17 changes: 14 additions & 3 deletions Dockerfile
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,24 @@ FROM node:20-alpine

WORKDIR /app

COPY package*.json ./
COPY package*.json .

RUN npm install

COPY . .
COPY index.js .

ENV PORT=7860
ENV DISCORD_CLIENT_ID=$DISCORD_CLIENT_ID
ENV DISCORD_BOT_TOKEN=$DISCORD_BOT_TOKEN
ENV DIRECT_MESSAGES=$DIRECT_MESSAGES
ENV DM_WHITELIST_ID=$DM_WHITELIST_ID
ENV OPENAI_API_KEY=$OPENAI_API_KEY
ENV HTTP_SERVER=$HTTP_SERVER
ENV DISCORD_MAX_RESPONSE_LENGTH=$DISCORD_MAX_RESPONSE_LENGTH
ENV API_ENDPOINT=$API_ENDPOINT
ENV MODEL=$MODEL
ENV DEBUG=$DEBUG
ENV UWU=$UWU
ENV SYSTEM_MESSAGE=$SYSTEM_MESSAGE

EXPOSE 7860

Expand Down
13 changes: 11 additions & 2 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ cd ChatGPT-Discord-BOT
- `OPENAI_API_KEY` - Get OpenAI API Key from [here](https://platform.openai.com/account/api-keys).

- `HTTP_SERVER` - HTTP Server (Optional). Values: `true` or `false`
- `PORT` - Port for HTTP Server. Default: `7860`. If you change the port, make sure to change it in the [Dockerfile](https://github.com/itskdhere/ChatGPT-Discord-BOT/blob/main/Dockerfile) as well.
- `PORT` - Port for HTTP Server. Default: `7860`.

#### **• Advanced Settings:**

Expand Down Expand Up @@ -173,7 +173,16 @@ cd ChatGPT-Discord-BOT
docker build -t itskdhere/chatgpt:3.2.4 .
```
```bash
docker run -d -p 7860:7860 --name chatgpt itskdhere/chatgpt:3.2.4
docker run -d -p 7860:7860 --env-file .env -v ./firebaseServiceAccountKey.json:/app/firebaseServiceAccountKey.json --name chatgpt itskdhere/chatgpt:3.2.4
```

#### **🐳 Using Docker Compose:**

```bash
docker compose build
```
```bash
docker compose up -d
```

#### **🟢 Without Docker:**
Expand Down
20 changes: 20 additions & 0 deletions compose.yml
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anaxios can you tell me why you chose the name cl4p-tp ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A mistake. Also, the network: proxy is a mistake too. My apologies.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok fine 👍
But why two PRs #23 & #24 ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still learning how PRs work. sorry.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, fine. No worries.
Goto PR #24 and push those changes to that branch, I'll merge that PR after that.

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
# sudo docker run -d -p 7860:7860 --name cl4t-tp cl4p-tp/chatgpt:3.2.4
version: "3.5"
services:
cl4p-tp:
build: .
container_name: cl4p-tp
restart: unless-stopped
env_file:
- .env
volumes:
- ./firebaseServiceAccountKey.json:/app/firebaseServiceAccountKey.json
ports:
- 7860:7860
networks:
- proxy

networks:
proxy:
external: true
Loading