mirror of https://github.com/MatrixTM/MHDDoS.git
refactor(docker): optimize Dockerfile for size and caching
This commit is contained in:
parent
0cb79779b3
commit
bd788aa6e8
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
|
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"]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue