Skip to content

Commit

Permalink
Add Docker support
Browse files Browse the repository at this point in the history
  • Loading branch information
slippersheepig committed Dec 9, 2022
1 parent 8f537db commit e35a41b
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 2 deletions.
28 changes: 28 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Use the official Python image as the base image
FROM python:3.10.8

# Create a user named appuser
RUN useradd -m appuser

# Switch to the appuser user
USER appuser

WORKDIR /home/appuser/

ENV PATH="/home/appuser/.local/bin:$PATH"

# Install pipenv
RUN pip install --user pipenv

# Pull the repository from Github
RUN git clone --depth=1 https://github.com/n3d1117/chatgpt-telegram-bot.git app

# Enter the repository directory
WORKDIR /home/appuser/app

# Install the dependencies specified in the Pipfile in the repository
RUN pipenv install --deploy

ENTRYPOINT ["python", "-m", "pipenv", "run"]
# Run the main.py file
CMD ["python", "main.py"]
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@ A [Telegram bot](https://core.telegram.org/bots/api) that integrates with OpenAI
- [x] Can reset conversation thread with the `/reset` command
- [x] Typing indicator while generating a response
- [x] Access can be restricted by specifying a list of allowed users
- [x] Docker support

## Additional Features - help needed!
- [ ] Multi-chat support
- Idea: cache different instances of `ChatGPT3Bot`, one for every chat id (maybe even persist them), so that every user has their own private conversation
- [ ] Support group chats
- Allow the bot to be used in group chats with specific commands
- [ ] Docker support
- With `Dockerfile` and `docker-compose.yml`. See [pull/2](https://github.com/n3d1117/chatgpt-telegram-bot/pull/2) for a start
- [ ] Advanced commands
- With premade ad-hoc prompts
- [ ] Token based authentication
Expand All @@ -37,6 +36,7 @@ PRs are always welcome!
## Getting started

### Installing
#### From Source
1. Clone the repository and navigate to the project directory:

```bash
Expand All @@ -54,6 +54,13 @@ pipenv install
pipenv shell
```

#### Docker Compose

```bash
wget https://raw.githubusercontent.com/n3d1117/chatgpt-telegram-bot/main/docker-compose.yml
docker-compose up -d
```

### Configuration
Customize the configuration by copying `.env.example` and renaming it to `.env`, then editing the settings as desired:
```bash
Expand Down
7 changes: 7 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: '3'
services:
chatgpt:
image: sheepgreen/chatgpt
volumes:
- ./.env:/home/appuser/app/.env
restart: always

0 comments on commit e35a41b

Please sign in to comment.