diff --git a/README.md b/README.md index f7915fc..58d83ab 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,17 @@ results = Stressify.run_test( ``` --- +## 📦 Using Stressify with Docker + +To run Stressify without installing anything locally, use Docker: + +```bash +docker pull jfilhogn/stressify:latest +docker run --rm jfilhogn/stressify:latest script.jl +``` + +Running the docker image this way will execute the script you want to run, making it easier to execute. In the directory `./docker` you can find the Dockerfile and the script.jl file that is used to run the image as example. + ## 🛠 Usage ### Example Test Script diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..26c7de8 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,9 @@ +FROM julia:1.11 + +WORKDIR /app + +COPY . . + +RUN julia -e 'using Pkg; Pkg.add("Stressify")' + +CMD ["julia", "--project=."] diff --git a/docker/firstTestDocker.jl b/docker/firstTestDocker.jl new file mode 100644 index 0000000..1e05096 --- /dev/null +++ b/docker/firstTestDocker.jl @@ -0,0 +1,14 @@ +import Pkg +Pkg.activate(".") +using Stressify + +#execute for the one VU for one iteration +Stressify.options( + vus = 1, + iterations = 1, + duration = nothing +) + +results = Stressify.run_test( + Stressify.http_get("https://httpbin.org/get"), +) diff --git a/docs/source/guide.rst b/docs/source/guide.rst index 1aabca2..8112ad5 100644 --- a/docs/source/guide.rst +++ b/docs/source/guide.rst @@ -89,6 +89,19 @@ The output will be a dictionary with the following structure: ---------- Resultados dos Checks ---------- +Using Docker to execute Stressify +================================= + +To run Stressify without installing anything locally, use Docker: + +.. code-block:: bash + + docker pull jfilhogn/stressify:latest + docker run --rm jfilhogn/stressify:latest script.jl + + +Running the docker image this way will execute the script you want to run, making it easier to execute. In the directory `./docker` you can find the Dockerfile and the script.jl file that is used to run the image as example. + Important Links -------------------