Skip to content

Commit

Permalink
Add Docker support (#5)
Browse files Browse the repository at this point in the history
* Add dockerignore file

* add dockerfile

* Add requirements.txt

* Update documentation to use docker
  • Loading branch information
verovaleros authored Apr 19, 2024
1 parent b62138c commit 910c6ca
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.git
.gitignore
.github
22 changes: 22 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM cgr.dev/chainguard/python:latest-dev as builder

WORKDIR /app

COPY requirements.txt .
RUN pip install --user -r requirements.txt \
&& rm -rf /home/nonroot/.cache/pip

FROM cgr.dev/chainguard/python:latest

ARG APP=/var/opt/app/
WORKDIR $APP

# Make sure you update Python version in path
#COPY --from=builder /home/nonroot/.local/lib/python3.12/site-packages /home/nonroot/.local/lib/python3.12/site-packages
COPY --from=builder /home/nonroot/.local /home/nonroot/.local

COPY number_anomaly_detector.py $APP/
COPY test-numbers.txt $APP/

CMD ["python", "/var/opt/app/number_anomaly_detector.py"]

8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,11 @@ values score

# Performace
Using the PCA model, is capable of training and testing 1 million numbers in 0.38 seconds

# Docker

To run the tool using Docker use our Docker Hub image:

```bash
docker run stratosphereips/numberanomalydetector:latest number_anomaly_detector.py -f test-numbers.txt
```
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
zat
pyod

0 comments on commit 910c6ca

Please sign in to comment.