mirror of
https://github.com/aljazceru/chatgpt-telegram-bot.git
synced 2026-01-06 06:26:23 +01:00
Add Docker support
This commit is contained in:
28
Dockerfile
Normal file
28
Dockerfile
Normal file
@@ -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
README.md
11
README.md
@@ -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
|
||||
@@ -37,6 +36,7 @@ PRs are always welcome!
|
||||
## Getting started
|
||||
|
||||
### Installing
|
||||
#### From Source
|
||||
1. Clone the repository and navigate to the project directory:
|
||||
|
||||
```bash
|
||||
@@ -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
|
||||
|
||||
7
docker-compose.yml
Normal file
7
docker-compose.yml
Normal file
@@ -0,0 +1,7 @@
|
||||
version: '3'
|
||||
services:
|
||||
chatgpt:
|
||||
image: sheepgreen/chatgpt
|
||||
volumes:
|
||||
- ./.env:/home/appuser/app/.env
|
||||
restart: always
|
||||
Reference in New Issue
Block a user