Adds Dockerfile, docker-compose, and updates README.

This commit is contained in:
uxname committed 2025-06-02 20:54:29 +03:00
1 parent 29c9e6df18
commit fa126651de
3 files changed
+75 -26

No files matched your search

+10
View File
@@ -0,0 +1,10 @@
FROM oven/bun:alpine
WORKDIR /app
COPY . .
RUN apk add git && bun install && bun run build && rm -rf .git
ENV NODE_ENV=production
CMD ["bun", "start"]
+55 -26
View File
@@ -1,54 +1,82 @@
# AI Pipelines with Telegram Bot # Aptos Hackathon
This project provides a framework for creating and executing AI-powered pipelines, with a Telegram bot interface for easy interaction. Project for Aptos Hackathon (backend)
## Features ## Features
- Execute AI-powered pipelines using OpenAI's models - Execute AI pipelines using OpenAI models
- Integration with Model Context Protocol (MCP) tools - Integration with Model Context Protocol (MCP)
- Telegram bot interface for easy interaction - Convenient Telegram bot interface
- Support for dynamic prompts and variables - Support for dynamic prompts and variables
## Prerequisites ## Running with Docker Compose (Recommended)
- Node.js and Bun installed ### Prerequisites
- OpenAI API key
- Telegram Bot Token (get it from [@BotFather](https://t.me/botfather))
## Setup - Docker and Docker Compose installed
- `.env` file with required environment variables
1. Clone the repository ### Setup
2. Install dependencies:
```bash 1. Copy `.env.example` to `.env` and configure the settings:
bun install
```
3. Copy `.env.example` to `.env` and fill in your credentials:
```bash ```bash
cp .env.example .env cp .env.example .env
``` ```
4. Edit the `.env` file and add your: 2. Edit the `.env` file and set:
- `OPENAI_API_KEY` - Your OpenAI API key - `OPENAI_API_KEY` - Your OpenAI API key
- `TELEGRAM_BOT_TOKEN` - Your Telegram bot token from @BotFather - `TELEGRAM_BOT_TOKEN` - Your Telegram bot token (get it from @BotFather)
- `MCP_SERVER_URL` - (Optional) MCP server URL (defaults to Santiment's MCP server) - `MCP_SERVER_URL` - (Optional) MCP server URL
## Running the Bot ### Running the Application
Start the bot with: Build and start the container:
```bash ```bash
bun start docker-compose up --build -d
``` ```
Or in development mode with auto-reload: ### Viewing Logs
```bash
docker-compose logs -f
```
### Stopping the Application
```bash
docker-compose down
```
## Local Development
### Prerequisites
- Bun installed
- Node.js
### Installing Dependencies
```bash
bun install
```
### Running the Application
In development mode with auto-reload:
```bash ```bash
bun --watch src/main.ts bun --watch src/main.ts
``` ```
Or in production mode:
```bash
bun run build
bun start
```
## Using the Bot ## Using the Bot
1. Find your bot on Telegram using the username you set with @BotFather 1. Find your bot on Telegram using the username you set with @BotFather
@@ -67,8 +95,9 @@ bun --watch src/main.ts
## Development ## Development
- Run linter: `bun run lint` - Run linter: `bun run lint`
- Run type checking: `bun run ts:check` - Type checking: `bun run ts:check`
- Run both: `bun run check` - Run all checks: `bun run check`
- Code formatting: `bun run lint:fix`
## License ## License
+10
View File
@@ -0,0 +1,10 @@
services:
app:
build: .
restart: unless-stopped
env_file:
- .env
volumes:
- ./.env:/app/.env
ports:
- "3000:3000"