mirror of https://github.com/MatrixTM/MHDDoS.git
Merge pull request #672 from H3xKatana/main
Optimize Dockerfile and docker image , adding Docker Compose support
This commit is contained in:
commit
8dc44b700f
21
Dockerfile
21
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"]
|
||||
|
|
|
|||
12
README.md
12
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'
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
||||
|
||||
|
|
@ -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
|
||||
Loading…
Reference in New Issue