uppal/telemt-docker

By uppal

Updated 5 months ago

Image
Networking
Security
0

2.2K

uppal/telemt-docker repository overview

telemt-docker

Docker Pulls Architecture Security: non-root Base Image Upstream

A minimal, secure, and production-oriented Docker image for Telemt — a fast MTProto proxy server (MTProxy) written in Rust + Tokio.

Built as a fully static binary and shipped in a distroless runtime image, running as non-root by default.


Features

  • Secure by default: Distroless runtime + non-root user.
  • Multi-arch: Supports amd64 and arm64.
  • Fully static binary: Designed for gcr.io/distroless/static:nonroot.
  • Config-driven: You mount a single /etc/telemt.toml and go.
  • Metrics-ready: Supports Telemt metrics port (9090) via config.
  • Build-time pinning: Upstream repo/ref are configurable via build args.

Important Notice

Telemt is a Telegram proxy (MTProto). Operating proxies may be restricted or monitored depending on your country/ISP and may carry legal/operational risks.

You are responsible for compliance with local laws and for safe deployment (firewalling, access control, logs, monitoring).


Quick Start (Docker Compose)

1. Generate a Secret

Telemt users require a 32-hex-char secret (16 bytes):

openssl rand -hex 16
2. Create telemt.toml

Refer to the upstream repository for the configuration format and examples:

Place your configuration file as ./telemt.toml.

3. Create docker-compose.yml

Note: the container runs as non-root, but Telemt binds to 443 by default. To allow binding to privileged ports, we add NET_BIND_SERVICE.

services:
  telemt:
    image: uppal/telemt-docker:latest
    container_name: telemt
    restart: unless-stopped

    environment:
      RUST_LOG: "info"

    volumes:
      - ./telemt.toml:/etc/telemt.toml:ro

    ports:
      - "443:443/tcp"
      # If you enable metrics_port=9090 in config:
      # - "127.0.0.1:9090:9090/tcp"

    security_opt:
      - no-new-privileges:true
    cap_drop:
      - ALL
    cap_add:
      - NET_BIND_SERVICE
    read_only: true
    tmpfs:
      - /tmp:rw,nosuid,nodev,noexec,size=16m

    deploy:
      resources:
        limits:
          cpus: "0.50"
          memory: 256M

    logging:
      driver: json-file
      options:
        max-size: "10m"
        max-file: "3"
4. Start
docker compose up -d

Logs:

docker compose logs -f

Configuration

Environment Variables
VariableMandatoryDefaultDescription
RUST_LOGNoTelemt log level (e.g. info, debug, trace).
Volumes
Container PathPurpose
/etc/telemt.tomlMain Telemt configuration file (you mount it from the host).
Ports
PortPurpose
443/tcpMain MTProxy listener (commonly used for TLS-like traffic).
9090/tcpMetrics port (only if enabled in telemt.toml).

Container Behavior

  • ENTRYPOINT: telemt
  • CMD (default): /etc/telemt.toml

So the container effectively runs:

telemt /etc/telemt.toml

To use a different config path, override the command:

docker run ... uppal/telemt-docker:latest /path/to/config.toml

Traefik + Telemt Stack (One-Line Install)

The stack/ directory contains a production-ready deployment with Traefik as a TLS-passthrough reverse proxy in front of Telemt.

One-line install
curl -sSL https://raw.githubusercontent.com/uppaljs/telemt-docker/main/stack/install.sh | bash

The installer will:

  1. Install Docker if not present
  2. Ask for a listen port (default 443) and Fake TLS domain (default 1c.ru)
  3. Generate a random secret
  4. Download and configure all files
  5. Start the stack and print your tg://proxy link
Manual setup
git clone https://github.com/uppaljs/telemt-docker.git
cd telemt-docker/stack
cp telemt.toml.example telemt.toml
# Edit telemt.toml — replace REPLACE_WITH_32_HEX_CHARS with: openssl rand -hex 16
docker compose up -d
Stack layout
stack/
├── docker-compose.yml        # Traefik + Telemt services
├── install.sh                # One-line installer script
├── telemt.toml.example       # Sample Telemt config
└── traefik/
    ├── dynamic/
    │   └── tcp.yml           # TLS passthrough routing to Telemt
    └── static/
        └── .gitkeep
Environment variables (installer)
VariableDefaultDescription
LISTEN_PORT443External port for the proxy
FAKE_DOMAIN1c.ruDomain for Fake TLS masking
TELEMT_INTERNAL_PORT1234Internal Telemt listen port
INSTALL_DIR./mtproxy-dataWhere files are downloaded

Build

This Dockerfile supports pinning upstream Telemt source:

  • TELEMT_REPO (default: https://github.com/telemt/telemt.git)
  • TELEMT_REF (default: main)
Multi-arch build (amd64 + arm64)
docker buildx build \
  --platform linux/amd64,linux/arm64 \
  -t uppal/telemt-docker:latest \
  --push .
Build a specific upstream tag/branch/commit
docker buildx build \
  --build-arg TELEMT_REF=v1.1.0.0 \
  -t uppal/telemt-docker:v1.1.0.0 \
  --push .

Tag summary

Content type

Image

Digest

sha256:f1386dd02

Size

5.3 MB

Last updated

5 months ago

docker pull uppal/telemt-docker:318de19