-
-
Notifications
You must be signed in to change notification settings - Fork 786
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #894 from arkid15r/update-docker-image
Optimize docker image
- Loading branch information
Showing
3 changed files
with
71 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,20 @@ | ||
FROM python:3.11.9-slim | ||
RUN apt update | ||
|
||
RUN mkdir -p .data/results && \ | ||
apt-get update && \ | ||
apt-get install -y gcc libssl-dev && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
pip install --upgrade pip poetry | ||
|
||
WORKDIR /usr/src/owaspnettacker | ||
COPY . . | ||
RUN mkdir -p .data/results | ||
RUN apt-get update | ||
RUN apt-get install -y gcc libssl-dev | ||
RUN pip3 install --upgrade poetry | ||
RUN python -m poetry install | ||
|
||
COPY .data .data | ||
COPY nettacker nettacker | ||
COPY nettacker.py poetry.lock pyproject.toml README.md ./ | ||
|
||
RUN poetry install --no-root --without dev --without test | ||
|
||
ENV docker_env=true | ||
|
||
CMD [ "poetry", "run", "python", "./nettacker.py" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
version: "3" | ||
|
||
services: | ||
nettacker: | ||
build: | ||
context: . | ||
dockerfile: "Dockerfile" | ||
command: poetry run python nettacker.py --start-api --api-host 0.0.0.0 | ||
dockerfile: Dockerfile | ||
command: poetry run python ./nettacker.py --start-api --api-host 0.0.0.0 | ||
container_name: nettacker | ||
environment: | ||
- docker_env=true | ||
ports: | ||
- 5000:5000 | ||
volumes: | ||
- ./:/usr/src/owaspnettacker | ||
environment: | ||
- docker_env=true | ||
- ./nettacker:/usr/src/owaspnettacker/nettacker |