diff --git a/.build/Dockerfile b/.build/Dockerfile index a577290..277a83a 100644 --- a/.build/Dockerfile +++ b/.build/Dockerfile @@ -9,8 +9,7 @@ WORKDIR /root COPY . . RUN yarn install \ + && yarn build \ && rm -rf /usr/local/share/.cache - #&& yarn build - -CMD yarn build && yarn start +CMD yarn start diff --git a/.build/docker-compose.yml b/.build/docker-compose.yml index b1c1531..5299b53 100644 --- a/.build/docker-compose.yml +++ b/.build/docker-compose.yml @@ -6,4 +6,4 @@ services: context: .. dockerfile: .build/Dockerfile hostname: bing-tg - image: bing-tg + image: git.shihaam.dev/dockerfiles/bing-chat-telegram diff --git a/README.md b/README.md index ab7f57a..be67c7e 100644 --- a/README.md +++ b/README.md @@ -3,15 +3,21 @@ A Telegram bot that lets you interact with the Bing AI from chats that you allow in the config. **> To start using this project,** - +- Git clone and cd into cloned dir - Run `yarn install` to install the dependencies. - Create a `.env` file or set environment variables according to the reference file `.env.example` - Run `yarn dev` or `yarn build && yarn start` to start the bot. **> To start using this project using Docker,** +- Git clone and cd into cloned dir +- Run `docker compose -f .build/docker-compose.yml build` to build the container. +- Create a `.env` file or set environment variables according to the reference file `.env.example` +- Run `docker compose up -d` to start the bot. +- Run `docker compose -f .build/docker-compose.yml push` to push container to registry. -- Run `docker compose -f .build/docker-compose.yml build` to build the container -- TODO +**> To start using this project using Docker in prod,** +- Create `docker-compose.yml` with the content from `docker-compose.yml` in repo. +- Create `.env` with the required variables. (see .env.example in repo) - Run `docker compose up -d` to start the bot. **> To enable Telegram command autocompletion,** diff --git a/docker-compose.yml b/docker-compose.yml index 7975f9d..c2bff65 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,6 +3,7 @@ services: ######################### bing-tg: hostname: bing-tg - image: bing-tg - volumes: - - ./variables.ts:/root/variables.ts + image: git.shihaam.dev/dockerfiles/bing-chat-telegram + env_file: + - .env + restart: always