{"id":17989552,"url":"https://github.com/evilfreelancer/docker-telegram-bot-api","last_synced_at":"2025-03-25T23:30:48.232Z","repository":{"id":236662468,"uuid":"629182856","full_name":"EvilFreelancer/docker-telegram-bot-api","owner":"EvilFreelancer","description":"Simple Docker image with Telegram Bot API server inside","archived":false,"fork":false,"pushed_at":"2023-04-17T21:50:42.000Z","size":13,"stargazers_count":11,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-20T22:10:20.912Z","etag":null,"topics":["docker","docker-compose","telegram-bot-api"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/evilfreelancer/docker-telegram-bot-api","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EvilFreelancer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-17T19:50:18.000Z","updated_at":"2025-03-06T07:36:21.000Z","dependencies_parsed_at":"2024-04-28T05:53:28.103Z","dependency_job_id":"416f64c5-4a17-4a8a-94df-d3331c1bbdce","html_url":"https://github.com/EvilFreelancer/docker-telegram-bot-api","commit_stats":null,"previous_names":["evilfreelancer/docker-telegram-bot-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvilFreelancer%2Fdocker-telegram-bot-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvilFreelancer%2Fdocker-telegram-bot-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvilFreelancer%2Fdocker-telegram-bot-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EvilFreelancer%2Fdocker-telegram-bot-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EvilFreelancer","download_url":"https://codeload.github.com/EvilFreelancer/docker-telegram-bot-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245561162,"owners_count":20635683,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-compose","telegram-bot-api"],"created_at":"2024-10-29T19:14:55.958Z","updated_at":"2025-03-25T23:30:45.219Z","avatar_url":"https://github.com/EvilFreelancer.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Telegram Bot API Docker\n\nThis project provides a Docker container for the\n[Telegram Bot API](https://github.com/tdlib/telegram-bot-api)\nserver. With this container, you can quickly and easily deploy the\nTelegram Bot API server with customizable settings using\nenvironment variables.\n\n## Getting Started\n\nTo get started, first clone the repository:\n\n```shell\ngit clone https://github.com/EvilFreelancer/docker-telegram-bot-api.git\ncd docker-telegram-bot-api\n```\n\nNext, create a `docker-compose.yml` file by copying the provided\n`docker-compose.dist.yml`:\n\n```shell\ncp docker-compose.dist.yml docker-compose.yml\n```\n\nYou can customize the settings in the `docker-compose.yml` file by\nsetting the appropriate environment variables.\n\nIt is essential to replace the default values for `TELEGRAM_API_ID`\nand `TELEGRAM_API_HASH` with your own credentials. You can obtain\nthese credentials from the [Telegram Core API](https://my.telegram.org) website.\n\nBelow is a table describing each available variable:\n\n| Variable                         | Description                                              | Default |\n|----------------------------------|----------------------------------------------------------|---------|\n| TELEGRAM_STAT                    | Enable the HTTP statistics API. Set to \"true\" to enable. | false   |\n| TELEGRAM_LOCAL                   | Enable local mode. Set to \"true\" to enable.              | false   | \n| TELEGRAM_API_ID                  | Your Telegram API ID.                                    |         |\n| TELEGRAM_API_HASH                | Your Telegram API Hash.                                  |         |\n| TELEGRAM_LOG_FILE                | Path to the log file.                                    |         |\n| TELEGRAM_FILTER                  | Filter users and chats to restrict access.               |         |\n| TELEGRAM_MAX_WEBHOOK_CONNECTIONS | Set the maximum number of webhook connections.           |         |\n| TELEGRAM_VERBOSITY               | Set the log verbosity level.                             |         |\n| TELEGRAM_MAX_CONNECTIONS         | Set the maximum number of connections.                   |         |\n| TELEGRAM_PROXY                   | Set a proxy server for the Telegram Bot API.             |         |\n| TELEGRAM_HTTP_IP_ADDRESS         | Set the IP address to bind the HTTP server to.           |         |\n\n## Using the Pre-built Docker Image\n\nIf you prefer not to build the Docker image yourself, you can use\nthe pre-built image available on Docker Hub. This image is\nautomatically built and pushed to Docker Hub whenever a new\ncommit is made to the [tdlib/telegram-bot-api](https://github.com/tdlib/telegram-bot-api) repository.\n\nTo use the pre-built Docker image, update the `docker-compose.yml`\nfile with the pre-built image details:\n\n```yaml\nversion: \"3.9\"\n\nservices:\n  telegram-bot-api:\n    restart: unless-stopped\n    image: evilfreelancer/docker-telegram-bot-api:latest # use image instead of build.context\n    environment:\n      TELEGRAM_STAT: \"true\"\n      TELEGRAM_LOCAL: \"true\"\n      TELEGRAM_API_ID: \"123\"\n      TELEGRAM_API_HASH: \"hash\"\n    volumes:\n      - ./telegram-bot-api_data:/var/lib/telegram-bot-api\n    ports:\n      - \"127.0.0.1:8081:8081\"\n      - \"127.0.0.1:8082:8082\"\n    logging:\n      driver: \"json-file\"\n      options:\n        max-size: \"50k\"\n```\n\n## Customizing Telegram Bot API Version\n\nAdditionally, you can specify a specific branch, tag, or commit of\nthe Telegram Bot API during the build process by setting the\n`TELEGRAM_API_REF` build argument. This argument can be customized\nin the `docker-compose.yml` file under the `args` section in the\n`build` block.\n\nFor example, if you want to build the container using a specific\nrelease, such as `v1.2.3`, you can set the `TELEGRAM_API_REF` in\nthe `docker-compose.yml` file:\n\n```yaml\nservices:\n  telegram-bot-api:\n    build:\n      context: ./telegram-bot-api\n      args:\n        TELEGRAM_API_REF: v1.2.3\n    # Remaining docker-compose.yml contents...\n```\n\nBy default, if the `TELEGRAM_API_REF` argument is not set, the latest\ncommit on the `master` branch will be used.\n\n## Configuring Ports\n\nThe Telegram Bot API server exposes two ports by default:\n\n* `8081`: The main API port for receiving updates and sending requests to the server.\n* `8082`: The statistics port for monitoring the server's performance and activity (only available when `TELEGRAM_STAT` is set to \"true\").\n\nIn the docker-compose.yml file, you can configure the ports mapping\nbetween the host machine and the container. The provided\n`docker-compose.dist.yml` file contains the following port mappings:\n\n```yaml\nports:\n  - \"127.0.0.1:8081:8081\"\n  - \"127.0.0.1:8082:8082\"\n```\n\nThis configuration binds the container's port `8081` to the host's\nport `8081` and the container's port `8082` to the host's port\n`8082`. Both ports are bound to the localhost (`127.0.0.1`) to\nrestrict access to the local machine.\n\n### Customizing Port Bindings\n\nIf you need to change the host port or bind the ports to a different\nIP address, you can modify the `ports` section in the\n`docker-compose.yml` file. For example, to bind the main API port\nto `8000` and make it accessible from any IP address, you can\nupdate the configuration like this:\n\n```yaml\nports:\n  - \"0.0.0.0:8000:8081\"\n  - \"127.0.0.1:8082:8082\"\n```\n\nWith this configuration, the Telegram Bot API server will be\naccessible on port `8000` from any IP address, while the statistics\nport will still be restricted to localhost access on port `8082`.\n\n## Running the Telegram Bot API Server\n\n### Building and Running the Container\n\nOnce you've configured the `docker-compose.yml` file, you can start\nthe Telegram Bot API server by running:\n\n```shell\ndocker-compose up -d\n```\n\nThe `-d` flag will start the container in detached mode, allowing\nit to run in the background.\n\n### Viewing Logs\n\nTo view the logs of the running Telegram Bot API server, you can\nuse the following command:\n\n```shell\ndocker-compose logs -f telegram-bot-api\n```\n\nThe `-f` flag will follow the logs in real-time, allowing you to monitor\nthe server's output as events occur.\n\n### Stopping the Container\n\nIf you need to stop the Telegram Bot API server, you can use the\nfollowing command:\n\n```shell\ndocker-compose down\n```\n\nThis command will stop and remove the running container. Note that\nthis will not remove the Docker image that you built earlier.\n\n### Rebuilding the Container\n\nIf you make changes to the `docker-compose.yml` file or the `Dockerfile`,\nyou'll need to rebuild the container. To do this, first stop the\nrunning container using the `docker-compose down` command. Then,\nbuild and start the updated container with the following command:\n\n```shell\ndocker-compose up -d --build\n```\n\nThe `--build` flag ensures that the Docker image is rebuilt before\nstarting the container.\n\n## Links\n\n* [Official Telegram Bot API Repository](https://github.com/tdlib/telegram-bot-api)\n* [TDLight Bot API features](https://github.com/tdlight-team/tdlight-telegram-bot-api)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevilfreelancer%2Fdocker-telegram-bot-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevilfreelancer%2Fdocker-telegram-bot-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevilfreelancer%2Fdocker-telegram-bot-api/lists"}