diff --git a/Dockerfile b/Dockerfile index 41c19bb..b4e7bd1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,20 @@ -FROM python:3.8.12-buster +# much smaller image than debian based python images +FROM python:3.12-slim + +LABEL maintainer="0xkatana" WORKDIR /app -COPY ./ ./ -COPY files files -RUN pip3 install -r requirements.txt +# Install git +RUN apt-get update && apt-get install -y git && apt-get clean -ENTRYPOINT ["python3", "/app/start.py"] +# copy requirements.txt for better caching +COPY requirements.txt . + +# Install py dependencies (may migrate to uv later) +RUN pip install --no-cache-dir -r requirements.txt + +# Copy all code at once instead of copy code then files +COPY . . + +ENTRYPOINT ["python", "start.py"] diff --git a/README.md b/README.md index 058e437..8ec5520 100644 --- a/README.md +++ b/README.md @@ -138,6 +138,18 @@ pip install -r requirements.txt apt -y update && apt -y install curl wget libcurl4 libssl-dev python3 python3-pip make cmake automake autoconf m4 build-essential git && git clone https://github.com/MatrixTM/MHDDoS.git && cd MH* && pip3 install -r requirements.txt ``` +**Docker** + +```shell script +git clone https://github.com/MatrixTM/MHDDoS.git +cd MHDDoS +docker compose build +# you can use the built image directly by uncommenting one line in the dockercompose +docker compose run -it --entrypoint /bin/bash mhddos + +``` + + [python3]: https://python.org 'Python3' [github issues]: https://github.com/MatrixTM/MHDDoS/issues 'enter' diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..6862793 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,14 @@ +version: "3.9" + +services: + mhddos: + # image: ghcr.io/mhprodev/mhddos:latest + build: . + container_name: mhddos + restart: unless-stopped + volumes: + - ./config.json:/app/config.json + - ./files:/app/files + + + diff --git a/requirements.txt b/requirements.txt index cefd72f..6908519 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,4 +7,4 @@ psutil>=5.9.3 icmplib>=2.1.1 pyasn1==0.4.8 pyroxy @ git+https://github.com/MatrixTM/PyRoxy.git -yarl>=1.7.2 +yarl>=1.7.2 \ No newline at end of file