-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.example.yml
More file actions
46 lines (44 loc) · 1.67 KB
/
Copy pathdocker-compose.example.yml
File metadata and controls
46 lines (44 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# GramIO local Bot API server — base compose.
#
# FILE_SERVER=1 makes the server also serve downloaded files over HTTP (port 8080)
# at token-less, path-based URLs, so the bot needs no shared volume — it talks HTTP
# only. (Prefer one process per container? Drop FILE_SERVER and add the nginx sidecar:
# docker compose -f docker-compose.example.yml -f docker-compose.nginx.yml up -d )
#
services:
telegram-bot-api:
image: ghcr.io/gramiojs/telegram-bot-api:latest
restart: unless-stopped
environment:
# from .env — see .env.example
TELEGRAM_API_ID: ${TELEGRAM_API_ID}
TELEGRAM_API_HASH: ${TELEGRAM_API_HASH}
FILE_SERVER: "1" # serve downloaded files on :8080 (token-less URLs)
# TELEGRAM_LOCAL: "0" # uncomment to keep the cloud-style URL download flow
volumes:
- telegram-bot-api-data:/var/lib/telegram-bot-api
ports:
- "8081:8081" # Bot API
- "8080:8080" # file downloads
# - "8082:8082" # stats (optional, used by the healthcheck internally)
healthcheck:
test: ["CMD", "curl", "-fsS", "http://127.0.0.1:8082/"]
interval: 30s
timeout: 5s
start_period: 20s
retries: 3
# Example GramIO bot — no volume, talks HTTP only.
bot:
build: ./example-bot
restart: unless-stopped
depends_on:
telegram-bot-api:
condition: service_healthy
environment:
BOT_TOKEN: ${BOT_TOKEN}
# GramIO: api.baseURL — note the required /bot suffix.
API_BASE_URL: http://telegram-bot-api:8081/bot
# where the bundled file server is reachable (for building download URLs)
FILES_BASE_URL: http://telegram-bot-api:8080
volumes:
telegram-bot-api-data: