mirror of
https://github.com/tiennm99/openai-status-bot.git
synced 2026-09-10 06:20:50 +00:00
build(compose): use canonical compose files
This commit is contained in:
@@ -37,20 +37,20 @@ a managed MongoDB Atlas cluster, so a reachable `MONGODB_URI` is required to
|
||||
start. The development and production setups share one cluster and differ only
|
||||
by database name (`MONGODB_DATABASE`).
|
||||
|
||||
Development runtime (targets the `openai_status_bot_dev` database):
|
||||
|
||||
```bash
|
||||
cp .env.example .env
|
||||
# edit .env and set TELEGRAM_BOT_TOKEN and MONGODB_URI (Atlas connection string)
|
||||
docker compose up --build
|
||||
```
|
||||
|
||||
Production runtime (uses the `MONGODB_DATABASE` from `.env`, default `openai_status_bot`):
|
||||
Production runtime (default Compose file; uses the `MONGODB_DATABASE` from `.env`, default `openai_status_bot`):
|
||||
|
||||
```bash
|
||||
cp .env.example .env
|
||||
# edit .env and set TELEGRAM_BOT_TOKEN, MONGODB_URI, and MONGODB_DATABASE
|
||||
docker compose -f docker-compose.bot.yml up -d --build
|
||||
docker compose up -d --build
|
||||
```
|
||||
|
||||
Development runtime (targets the `development` database):
|
||||
|
||||
```bash
|
||||
cp .env.example .env
|
||||
# edit .env and set TELEGRAM_BOT_TOKEN and MONGODB_URI (Atlas connection string)
|
||||
docker compose -f compose.dev.yaml up --build
|
||||
```
|
||||
|
||||
For local development without Docker:
|
||||
@@ -66,7 +66,7 @@ go run ./cmd/openai-status-bot
|
||||
|----------|---------|-------------|
|
||||
| `TELEGRAM_BOT_TOKEN` | required | Telegram bot token from BotFather |
|
||||
| `MONGODB_URI` | required | MongoDB connection string, e.g. an Atlas `mongodb+srv://user:pass@cluster/` URI |
|
||||
| `MONGODB_DATABASE` | `openai_status_bot` | Database name; use a separate name (e.g. `openai_status_bot_dev`) to split dev and prod on one cluster |
|
||||
| `MONGODB_DATABASE` | `openai_status_bot` | Database name; use a separate name (e.g. `development`) to split dev and prod on one cluster |
|
||||
| `POLL_INTERVAL` | `1m` | Status check interval, valid `5s`-`1h` |
|
||||
| `HTTP_TIMEOUT` | `10s` | HTTP request timeout, valid `1s`-`5m` |
|
||||
| `LOG_LEVEL` | `info` | `debug`, `info`, `warn`/`warning`, or `error` |
|
||||
|
||||
@@ -7,5 +7,5 @@ services:
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
MONGODB_DATABASE: openai_status_bot_dev
|
||||
MONGODB_DATABASE: development
|
||||
restart: unless-stopped
|
||||
@@ -1,4 +1,4 @@
|
||||
# Production runtime: bot only, connecting to the shared Atlas cluster via .env.
|
||||
# Default production runtime: bot only, connecting to the shared Atlas cluster via .env.
|
||||
# Uses the production database (MONGODB_DATABASE in .env, default
|
||||
# openai_status_bot). There is no local datastore.
|
||||
services:
|
||||
+5
-5
@@ -6,19 +6,19 @@
|
||||
- MongoDB Atlas cluster (managed, no local MongoDB service required)
|
||||
- Telegram bot token from BotFather
|
||||
|
||||
## Local Docker Run
|
||||
## Development Docker Run
|
||||
|
||||
```bash
|
||||
cp .env.example .env
|
||||
# set TELEGRAM_BOT_TOKEN in .env
|
||||
# set MONGODB_URI to your MongoDB Atlas connection string
|
||||
# docker compose sets MONGODB_DATABASE=openai_status_bot_dev for local development
|
||||
docker compose up --build
|
||||
# docker compose sets MONGODB_DATABASE=development for local development
|
||||
docker compose -f compose.dev.yaml up --build
|
||||
```
|
||||
|
||||
The Docker Compose service connects to MongoDB Atlas; there is no bundled local MongoDB. Ensure `MONGODB_URI` is set in `.env`.
|
||||
|
||||
## Bot-Only Docker Run
|
||||
## Production Docker Run
|
||||
|
||||
Use this for production deployment:
|
||||
|
||||
@@ -27,7 +27,7 @@ cp .env.example .env
|
||||
# set TELEGRAM_BOT_TOKEN in .env
|
||||
# set MONGODB_URI to your MongoDB Atlas connection string
|
||||
# MONGODB_DATABASE defaults to openai_status_bot (production)
|
||||
docker compose -f docker-compose.bot.yml up -d --build
|
||||
docker compose up -d --build
|
||||
```
|
||||
|
||||
## Local Go Run
|
||||
|
||||
Reference in New Issue
Block a user