added docker support

This commit is contained in:
Shihaam Abdul Rahman 2023-04-08 16:08:49 +05:00
parent 178f00147c
commit 8a255d41af
Signed by: shihaam
GPG Key ID: 6DA2E87EBC227636
4 changed files with 40 additions and 0 deletions

16
.build/Dockerfile Normal file
View File

@ -0,0 +1,16 @@
FROM node:18.15.0-alpine3.17
# Set build shell to bash, default has has some issues sometimes
#SHELL ["/bin/bash", "-c"]
WORKDIR /root
COPY . .
RUN yarn install \
&& rm -rf /usr/local/share/.cache
#&& yarn build
CMD yarn build && yarn start

View File

@ -0,0 +1,9 @@
version: '3.5'
services:
#########################
bing-tg:
build:
context: ..
dockerfile: .build/Dockerfile
hostname: bing-tg
image: bing-tg

View File

@ -8,6 +8,13 @@ A Telegram bot that lets you interact with the Bing AI from chats that you allow
* Copy `variables.example.ts` to `variables.ts`, go through it, and add the required information.
* Run `yarn dev` or `yarn build && yarn start` to start the bot.
### OR using docker
**> To start using this project,**
* Run `docker compose -f .build/docker-compose.yml build` to build the container
* Copy `variables.example.ts` to `variables.ts`, go through it, and add the required information.
* Run `docker compose up -d` to start the bot.
**> To enable Telegram command autocompletion,**
* Press the `Edit Commands` button in your bot's menu on BotFather, and paste the following:
```

8
docker-compose.yml Normal file
View File

@ -0,0 +1,8 @@
version: '3.5'
services:
#########################
bing-tg:
hostname: bing-tg
image: bing-tg
volumes:
- ./variables.ts:/root/variables.ts