Spaces:
Paused
Paused
Download config-example.py from no-name-here/proxy: direct link, hf CLI and curl.
- Browser
- Download file 1.89 kB
-
https://huggingface.co/spaces/no-name-here/proxy/resolve/main/config-example.py
- Command line
-
hf download hf://spaces/no-name-here/proxy/config-example.py
-
curl -L -o config-example.py https://huggingface.co/spaces/no-name-here/proxy/resolve/main/config-example.py
1.89 kB
| FROM ubuntu:22.04 | |
| ENV DEBIAN_FRONTEND=noninteractive | |
| # ββ Build dependencies ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| RUN apt-get update && apt-get install -y \ | |
| cmake \ | |
| g++ \ | |
| git \ | |
| libssl-dev \ | |
| zlib1g-dev \ | |
| gperf \ | |
| make \ | |
| curl \ | |
| ca-certificates \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # ββ Clone and build the official Telegram Bot API server βββββββββββββββββββββ | |
| # Pin to a specific commit for reproducibility | |
| RUN git clone --recursive https://github.com/tdlib/telegram-bot-api.git /tmp/telegram-bot-api | |
| WORKDIR /tmp/telegram-bot-api | |
| RUN mkdir build && cd build && \ | |
| cmake -DCMAKE_BUILD_TYPE=Release \ | |
| -DCMAKE_INSTALL_PREFIX:PATH=/usr/local \ | |
| .. && \ | |
| cmake --build . --target install -j$(nproc) | |
| # ββ Runtime setup βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| RUN mkdir -p /data /var/log/telegram-bot-api | |
| # HuggingFace Spaces requires the app to run as a non-root user | |
| RUN useradd -m -u 1000 botapi && \ | |
| chown -R botapi:botapi /data /var/log/telegram-bot-api | |
| USER botapi | |
| # HF Spaces exposes port 7860 | |
| EXPOSE 7860 | |
| # ββ Entrypoint ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| # API_ID and API_HASH must be set as HF Space secrets | |
| CMD telegram-bot-api \ | |
| --api-id=${API_ID} \ | |
| --api-hash=${API_HASH} \ | |
| --http-port=7860 \ | |
| --dir=/data \ | |
| --temp-dir=/data/temp \ | |
| --log=/var/log/telegram-bot-api/server.log \ | |
| --verbosity=1 |