Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions tests/siege/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM ubuntu:latest

# Update packages and install necessary tools
RUN apt-get update && \
apt-get install -y \
build-essential \
# Includes g++ and make
git \
curl \
vim \
siege \
# Optional, for editing inside the container
&& rm -rf /var/lib/apt/lists/*

# Set the working directory inside the container
WORKDIR /app

# Default command or entrypoint
CMD ["bash"]
39 changes: 39 additions & 0 deletions tests/siege/siege.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Test Webserv with Siege in a Docker Environment

## 1. Build the Docker Image

Use the Dockerfile in this folder.

From the **root** directory build the Docker image:

```bash
docker build -t ubuntu-siege -f tests/siege/Dockerfile .
```

## 2. Start the first interactive session

1. Run Siege interactively within the container, use:

```bash
docker run --name ubuntu-siege-session --rm -it -v "$(pwd):/app" ubuntu-siege /bin/bash

```

## 3. Compile the webserver

`make re`

### 4. Start a second interactive section

```bash
docker exec -it ubuntu-siege-session /bin/bash
```

### 5. Stress test the webserv


Inside the container, you can execute commands like:

```bash
siege -c10 -d5 -t1M http://localhost:80
```