diff --git a/Dockerfile b/Dockerfile index 95efa8064..c8a09ce4e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,5 @@ -FROM python:3.11.10-slim +### Build stage +FROM python:3.11.10-slim AS builder RUN apt-get update && \ apt-get install -y gcc libssl-dev && \ @@ -13,6 +14,12 @@ COPY nettacker.py poetry.lock pyproject.toml README.md ./ RUN poetry install --no-cache --no-root --without dev --without test +### Runtime stage +FROM python:3.11.10-slim +COPY --from=builder /usr/src/owaspnettacker /usr/src/owaspnettacker + ENV docker_env=true +WORKDIR /usr/src/owaspnettacker + CMD [ "poetry", "run", "python", "./nettacker.py" ]