/
codespawn
/
tgstream
Обзор
Документация
Войти
/
codespawn
/
tgstream
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
16
CI/CD
Аналитика
Безопасность
master
deploy/docker/docker-compose.yml
87 строк
4 KB
codespawn
Запрос на слияние 'feat/cli-config-override' (
#14
) из feat/cli-config-override в master
26 июл 2026, 18:09
Верифицирован
26 июл 2026, 18:09
3472af2
Код
Авторство
О чём код?
version: "3.8" services: tgstream: # CMD образа уже включает `serve` (Dockerfile), так что явно `command:` # задавать не нужно. Если переопределяете — не забудьте serve: Kong требует # subcommand, без него (просто `tgstream`) выводится usage и ненулевой exit. build: context: ../.. dockerfile: deploy/docker/Dockerfile # Версия бинарника в образе (для tgstream --version / стартового лога). # Compose не вычисляет shell, поэтому значения берутся из env-переменных # (через .env или TGSTREAM_VERSION=v1.2.3 docker compose build). Без них — # дефолты Dockerfile (dev/none/unknown). См. Makefile (цель build) — та же # схема -ldflags; deploy/.env.example для документации. args: VERSION: ${TGSTREAM_VERSION:-dev} COMMIT: ${TGSTREAM_COMMIT:-none} DATE: ${TGSTREAM_DATE:-unknown} container_name: tgstream restart: unless-stopped ports: - "8080:8080" volumes: # SQLite database (post history). Keep it on a persistent volume. - ./data:/app/data # DSL extraction configs (required: TGSTREAM_SOURCE_CONFIGS_DIR points here). # Ships telegram.yaml by default (see deploy/websource-configs/). - ../../deploy/websource-configs:/app/websource-configs:ro # Optional: mount a YAML config file and point TGSTREAM_CONFIG_FILE at it. # - ./config.yaml:/etc/tgstream/config.yaml:ro environment: - TGSTREAM_SERVER_PORT=8080 - TGSTREAM_STORE_DB_PATH=/app/data/tgstream.db - TGSTREAM_CACHE_TTL=5m - TGSTREAM_CACHE_SIZE=1000 # Required: directory with DSL extraction configs (*.yaml/*.yml/*.json). # Ships deploy/websource-configs/telegram.yaml by default. - TGSTREAM_SOURCE_CONFIGS_DIR=/app/websource-configs - TGSTREAM_SOURCE_TIMEOUT=15s - TGSTREAM_SOURCE_MAX_CONCURRENCY=4 - TGSTREAM_SOURCE_MAX_RPS=2 - TGSTREAM_SERVER_READ_TIMEOUT=15s - TGSTREAM_SERVER_WRITE_TIMEOUT=30s - TGSTREAM_SERVER_SHUTDOWN_TIMEOUT=10s - LOG_FORMAT=json - LOG_LEVEL=info # Optional: load configuration from a mounted YAML file. # - TGSTREAM_CONFIG_FILE=/etc/tgstream/config.yaml # Optional: external render service for JS-rendered pages (prerender-compatible # protocol: GET <renderURL>/<target>). Needed only if a config sets render:true. # - TGSTREAM_SOURCE_RENDER_URL=http://renderer:3000 # Optional: upstream HTTP proxy for Source + media-proxy clients. # Standard Go mechanism (http.DefaultTransport) — no TGSTREAM_ prefix. # SOCKS5 is NOT supported. Applies per-host via HTTP_PROXY/HTTPS_PROXY. # - HTTP_PROXY=http://proxy.example.com:8080 # - HTTPS_PROXY=http://proxy.example.com:8080 # - NO_PROXY=localhost,127.0.0.1 # Optional: serve media via /media (rewrites media URLs to use BASE_URL). # Requires TGSTREAM_BASE_URL when MEDIA_PROXY_ENABLED=true, otherwise the # service fails to start. TGSTREAM_MEDIA_PROXY_ALLOWED_HOSTS is required # when enabled (comma-separated host suffixes for SSRF protection; # empty → all media URLs rejected). # - TGSTREAM_MEDIA_PROXY_ENABLED=true # - TGSTREAM_BASE_URL=https://tgstream.example.com # - TGSTREAM_MEDIA_PROXY_CLIENT_TIMEOUT=20s # - TGSTREAM_MEDIA_PROXY_ALLOWED_HOSTS=telegram-cdn.org,telesco.pe,telegram.org,t.me healthcheck: test: [ "CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/healthz", ] interval: 30s timeout: 3s retries: 3 start_period: 5s networks: - tgstream-network networks: tgstream-network: driver: bridge