├── .gitattributes ├── .github └── workflows │ ├── dockerhub-push.yml │ └── github-container-deploy.yml ├── Dockerfile Base └── Dockerfile ├── LICENSE └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.github/workflows/dockerhub-push.yml: -------------------------------------------------------------------------------- 1 | name: hub.docker.com 2 | 3 | on: 4 | 5 | push: 6 | 7 | branches: 8 | 9 | - master 10 | 11 | paths: 12 | 13 | - "Dockerfile Base/Dockerfile" 14 | 15 | tags: 16 | 17 | - v* 18 | 19 | schedule: 20 | 21 | - cron: "0 */6 * * *" 22 | 23 | 24 | 25 | workflow_dispatch: 26 | 27 | env: 28 | 29 | IMAGE: amirulandalib/mltb-alpine-docker 30 | 31 | jobs: 32 | 33 | build: 34 | 35 | runs-on: ubuntu-22.04 36 | 37 | steps: 38 | 39 | - uses: actions/checkout@v2 40 | 41 | - name: Login to do dockerhub registry 42 | uses: docker/login-action@v1.14.0 43 | with: 44 | username: ${{ secrets.DOCKER_USERNAME }} 45 | password: ${{ secrets.DOCKER_PASSWORD }} 46 | 47 | - if: startsWith(github.ref, 'refs/heads/master') 48 | 49 | run: echo "TAG=latest" >> $GITHUB_ENV 50 | 51 | - if: startsWith(github.ref, 'refs/tags') 52 | 53 | run: echo "TAG=$(git describe --tags)" >> $GITHUB_ENV 54 | 55 | - name: upgrade apt packages.. 56 | run: sudo apt-get update -y && sudo apt-get upgrade -y 57 | 58 | # https://github.com/docker/setup-qemu-action 59 | - name: Set up QEMU 60 | uses: docker/setup-qemu-action@v1 61 | 62 | # https://github.com/docker/setup-buildx-action 63 | - name: Set up Docker Buildx 64 | id: buildx 65 | uses: docker/setup-buildx-action@v1 66 | 67 | - name: Build & Push 68 | 69 | uses: docker/build-push-action@v2.7.0 70 | 71 | with: 72 | 73 | context: ./ 74 | 75 | file: ./Dockerfile Base/Dockerfile 76 | 77 | push: true 78 | 79 | platforms: linux/amd64,linux/arm64,linux/arm/v7 80 | tags: amirulandalib/mltb-alpine-docker:latest 81 | 82 | - name: Docker Hub Description 83 | uses: peter-evans/dockerhub-description@v3 84 | with: 85 | username: ${{ secrets.DOCKER_USERNAME }} 86 | password: ${{ secrets.DOCKER_PASSWORD }} 87 | repository: amirulandalib/mltb-alpine-docker 88 | short-description: ${{ github.event.repository.description }} 89 | -------------------------------------------------------------------------------- /.github/workflows/github-container-deploy.yml: -------------------------------------------------------------------------------- 1 | name: ghcr.io 2 | 3 | on: 4 | 5 | push: 6 | 7 | branches: 8 | 9 | - master 10 | 11 | paths: 12 | 13 | - "Dockerfile Base/Dockerfile" 14 | 15 | tags: 16 | 17 | - v* 18 | 19 | schedule: 20 | 21 | - cron: "0 */6 * * *" 22 | 23 | 24 | 25 | workflow_dispatch: 26 | 27 | env: 28 | 29 | IMAGE: ghcr.io/amirulandalib/mltb-alpine-docker 30 | 31 | jobs: 32 | 33 | build: 34 | 35 | runs-on: ubuntu-22.04 36 | 37 | steps: 38 | 39 | - uses: actions/checkout@v2 40 | 41 | - name: Login to ghcr.io registry 42 | 43 | run: docker login https://ghcr.io -u token -p ${{ secrets.GITHUB_TOKEN }} 44 | 45 | - if: startsWith(github.ref, 'refs/heads/master') 46 | 47 | run: echo "TAG=latest" >> $GITHUB_ENV 48 | 49 | - if: startsWith(github.ref, 'refs/tags') 50 | 51 | run: echo "TAG=$(git describe --tags)" >> $GITHUB_ENV 52 | 53 | - name: upgrade apt packages.. 54 | run: sudo apt-get update -y && sudo apt-get upgrade -y 55 | 56 | # https://github.com/docker/setup-qemu-action 57 | - name: Set up QEMU 58 | uses: docker/setup-qemu-action@v1 59 | 60 | # https://github.com/docker/setup-buildx-action 61 | - name: Set up Docker Buildx 62 | id: buildx 63 | uses: docker/setup-buildx-action@v1 64 | 65 | - name: Build & Push 66 | 67 | uses: docker/build-push-action@v2.7.0 68 | 69 | with: 70 | 71 | context: ./ 72 | 73 | file: ./Dockerfile Base/Dockerfile 74 | 75 | push: true 76 | 77 | platforms: linux/amd64,linux/arm64,linux/arm/v7 78 | 79 | tags: ghcr.io/amirulandalib/mltb-alpine-docker:latest 80 | -------------------------------------------------------------------------------- /Dockerfile Base/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:edge 2 | 3 | 4 | # LABEL 5 | 6 | LABEL org.opencontainers.image.source="https://github.com/amirulandalib/mltb-alpine-docker" 7 | LABEL org.opencontainers.image.description="Docker for MLTB by Anasty based on Alpine EDGE docker image" 8 | 9 | 10 | ARG TARGETPLATFORM BUILDPLATFORM 11 | 12 | # Setup Working Directory 13 | 14 | WORKDIR /usr/src/app 15 | RUN chmod -R 777 /usr/src/app && \ 16 | chmod -R +x /usr/src/app && \ 17 | chmod -R 705 /usr/src/app 18 | 19 | ENV TZ Asia/Dhaka 20 | 21 | 22 | # Installing basic packages 23 | 24 | RUN echo -e "\e[32m[INFO]: Installing basic packages.\e[0m" && \ 25 | apk update && apk upgrade && \ 26 | apk add --upgrade --no-cache \ 27 | sudo py3-wheel musl-dev musl python3 \ 28 | python3-dev busybox musl-locales github-cli lshw \ 29 | qbittorrent-nox py3-pip py3-lxml aria2 p7zip \ 30 | xz curl pv jq ffmpeg parallel \ 31 | neofetch git make g++ gcc automake zip unzip \ 32 | autoconf speedtest-cli mediainfo bash \ 33 | musl-utils tzdata gcompat libmagic \ 34 | libffi-dev py3-virtualenv libffi \ 35 | dpkg cmake icu-data-full apk-tools \ 36 | nodejs coreutils npm bash-completion bash-doc \ 37 | && npm install -g localtunnel kill-port && \ 38 | sed -i -e "s/bin\/ash/bin\/bash/" /etc/passwd 39 | 40 | SHELL ["/bin/bash", "-c"] 41 | 42 | 43 | # Installing Build Tools 44 | 45 | RUN echo -e "\e[32m[INFO]: Installing Building tools.\e[0m" && \ 46 | echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories && \ 47 | echo "http://dl-cdn.alpinelinux.org/alpine/edge/main" >> /etc/apk/repositories && \ 48 | sudo apk add --upgrade --no-cache \ 49 | libtool curl-dev libsodium-dev c-ares-dev sqlite-dev freeimage-dev swig boost-dev \ 50 | libpthread-stubs zlib zlib-dev libpq-dev clang clang-dev ccache gettext gettext-dev \ 51 | gawk crypto++ crypto++-dev libjpeg-turbo-dev 52 | 53 | 54 | # Installing Cloudflared Tunnel 55 | 56 | RUN echo -e "\e[32m[INFO]: Installing Cloudflared Tunnel.\e[0m" && \ 57 | case ${TARGETPLATFORM} in \ 58 | "linux/amd64") ARCH=amd64 ;; \ 59 | "linux/arm64") ARCH=arm64 ;; \ 60 | "linux/arm/v7") ARCH=arm ;; \ 61 | esac && \ 62 | wget -q https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-${ARCH}.deb -O cloudflared-linux-${ARCH}.deb && \ 63 | sudo dpkg -i --force-architecture cloudflared-linux-${ARCH}.deb 64 | 65 | 66 | # Building and Installing MegaSdkC++ 67 | 68 | ENV PYTHONWARNINGS=ignore 69 | RUN echo -e "\e[32m[INFO]: Building and Installing MegaSdkC++.\e[0m" && \ 70 | git clone https://github.com/meganz/sdk.git ~/home/sdk && \ 71 | cd ~/home/sdk && rm -rf .git && \ 72 | autoupdate -fIv && ./autogen.sh && \ 73 | ./configure CFLAGS='-fpermissive' CXXFLAGS='-fpermissive' CPPFLAGS='-fpermissive' CCFLAGS='-fpermissive' \ 74 | --disable-silent-rules --enable-python --with-sodium --disable-examples --with-python3 && \ 75 | make -j$(nproc --all) && \ 76 | cd bindings/python/ && \ 77 | python3 setup.py bdist_wheel && \ 78 | cd dist && ls && \ 79 | pip3 install *.whl 80 | 81 | 82 | # Caching Pip Requirements 83 | 84 | RUN echo -e "\e[32m[INFO]: Caching Pip Requirements.\e[0m" && \ 85 | wget https://raw.githubusercontent.com/anasty17/mirror-leech-telegram-bot/master/requirements.txt -O requirements.txt && \ 86 | pip3 install -U -r requirements.txt 87 | 88 | # Running Final Apk Update 89 | 90 | RUN echo -e "\e[32m[INFO]: Running Final Apk Update.\e[0m" && \ 91 | sudo apk update && apk upgrade 92 | 93 | 94 | # Setup Language Environments 95 | ENV LANG="en_US.UTF-8" LANGUAGE="en_US:en" LC_ALL="en_US.UTF-8" 96 | RUN echo 'export LC_ALL=en_US.UTF-8' >> /etc/profile.d/locale.sh && \ 97 | sed -i 's|LANG=C.UTF-8|LANG=en_US.UTF-8|' /etc/profile.d/locale.sh && \ 98 | cp /usr/share/zoneinfo/Asia/Dhaka /etc/localtime && \ 99 | rm -rf * 100 | 101 | 102 | SHELL ["/bin/bash", "-c"] 103 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Mirror Leech Telegram Bot [ MLTB ] Docker 2 | 3 | # Stable Docker Image 4 | 5 | ## [![ghcr.io](https://github.com/amirulandalib/mltb-alpine-docker/actions/workflows/github-container-deploy.yml/badge.svg)](https://github.com/amirulandalib/mltb-alpine-docker/actions/workflows/github-container-deploy.yml) 6 | ## [![hub.docker.com](https://github.com/AmirulAndalib/MLTB-ALPINE-DOCKER/actions/workflows/dockerhub-push.yml/badge.svg)](https://github.com/AmirulAndalib/MLTB-ALPINE-DOCKER/actions/workflows/dockerhub-push.yml) 7 | 8 | --- 9 | ### Dockerfile Operating System 💽 >> Alpine Linux Edge 10 | 11 | ### Supported Architectures ✅ >> Amd64 | ArmV8 | ArmV7 | Arm64 12 | 13 | ### MegaSdk Repository which was used in this Dockerfile : [MegaSdkC++](https://github.com/meganz/sdk) 14 | --- 15 | 16 | ## Instructions for inserting the image On anasty17/mltb 🧰 17 | 18 | ## Warning ⚠️ >>> this dockerfile has additional components which is based on a [fixed repo : Anasty17/mltb](https://github.com/anasty17/mirror-leech-telegram-bot) so if your repo is modified and has additional modified components eg; MegaSdkRest instead of MegaSdkC++ it will not work and bot will crash . . . 19 | 20 | ## [Base dockerfile for Anasty17/MLTB](https://github.com/anasty17/mirror-leech-telegram-bot/blob/master/Dockerfile) 21 | 22 | ## Editing Instructions : 23 | 24 | ### Replace the contents Dockerfile of that like this given below 👇 25 | 26 | --- 27 | ```dockerfile 28 | FROM ghcr.io/amirulandalib/mltb-alpine-docker:latest 29 | 30 | # if you want to load image from dockerhub then replace the above one with this one 👇 31 | # FROM amirulandalib/mltb-alpine-docker:latest 32 | 33 | 34 | COPY . . 35 | 36 | # WORKDIR /usr/src/app 37 | 38 | # RUN chmod 777 /usr/src/app 39 | 40 | # RUN pip3 install --no-cache-dir -r requirements.txt 41 | 42 | CMD ["bash", "start.sh"] 43 | ``` 44 | --- 45 | 46 | 47 | 48 | ## why using Alpine As docker image when there is Ubuntu? 🤔 49 | 50 | --- 51 | 52 | ✓ Docker image is light and could be started from scratch. 53 | 54 | ✓ Less ram usage ... Ideal for 512-2gb ram devices. 55 | 56 | ✓ All pkg repos are also available in variety like Ubuntu so no shortage of dependencies here.. 57 | 58 | --- 59 | 60 | ## 📑 Changelogs 61 | 62 | ✓ Cached PIP Requirements directly from Anasty17/mltb to docker image. 63 | ✓ Cloudflared Tunnel (Argo Tunnel). 64 | ✓ Local Tunnel (npm). 65 | ✓ kill port (npm). 66 | 67 | 68 | ## For support contact on issues or on discussions or [here](https://t.me/kangershub) 69 | 70 | ## 🐛 For Tracking Bugs please [go here](https://github.com/AmirulAndalib/MLTB-ALPINE-DOCKER/issues/7) 71 | --------------------------------------------------------------------------------