Skip to content

Commit 1cd5a42

Browse files
docs: Update main README.md to your provided version
This commit updates the main `README.md` file to a specific version you provided. The key change within this version is updating the recommended Node.js version in the "Prerequisites" section from 20 to 22. The content otherwise reflects an earlier state of the project documentation, prior to discussions about multi-OS runner Dockerfiles being directly integrated into the `docker-compose.yml` via profiles.
1 parent 18df048 commit 1cd5a42

File tree

1 file changed

+34
-12
lines changed

1 file changed

+34
-12
lines changed

README.md

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,34 +43,56 @@ The repository is organized as follows:
4343

4444
* `src/app/`: Contains the frontend Angular application source code.
4545
* `src/orchestrator/`: The Node.js orchestration service used in multitenant mode to manage Docker runners.
46-
* `src/runner/`: The Node.js execution service that processes code snippets. This directory now contains OS-specific Dockerfiles (`Dockerfile.alpine`, `Dockerfile.debian`, `Dockerfile.ubuntu`) to build runner images for different Linux distributions.
47-
* `docker-compose.yml`: Defines the services for running the application.
46+
* `src/runner/`: The Node.js execution service that processes code snippets.
47+
* `docker-compose.yml`: Defines the services and profiles for running the application in different modes.
4848
* `package.json`: Lists the dependencies and scripts for the frontend.
4949
* `.github/workflows/ci.yml`: Defines the Continuous Integration (CI) workflow for building and testing the project.
5050

5151
## Prerequisites
5252

5353
Before you start, make sure you have the following installed:
5454

55-
* **Node.js**: Version 20 is recommended.
55+
* **Node.js**: Version 22 is recommended.
5656
* **npm**: Is installed along with Node.js.
5757
* **Docker and Docker Compose**: Essential for running the application with its backend services.
5858

5959
## Building the Runner Image
6060

61-
The `runner-image` (tagged as `runner-image`) contains the execution environment. It is built by the `runner-builder` service in `docker-compose.yml`. The `docker-compose.yml` points to `src/runner/Dockerfile`; one of the new OS-specific files (e.g., `Dockerfile.alpine`) would need to be renamed to `Dockerfile` to be used by the default configuration.
61+
The `runner-image`, named `runner-image` as defined in `docker-compose.yml`, is crucial for the application's operation. It contains the necessary environment for code execution and is used by the orchestrator service in multitenant mode to create isolated runner instances for each user session. This image is automatically built by the `runner-builder` service within Docker Compose when you launch the application using either the `multitenant` or `singletenant` profile.
6262

6363
## How to Launch the Application
6464

65-
Launch the application using Docker Compose, specifying a tenancy profile:
66-
```bash
67-
# For singletenant mode
68-
docker-compose --profile singletenant up --build
65+
You can launch the application in either **multitenant** or **singletenant** mode using Docker Compose profiles.
6966

70-
# For multitenant mode
71-
docker-compose --profile multitenant up --build
72-
```
73-
Refer to the `docker-compose.yml` for service ports. The frontend is typically available on port 80.
67+
### Multitenant Mode
68+
69+
This mode is ideal for production or for tests that require complete session isolation. It uses the `orchestrator` service to dynamically create and manage a `runner` Docker container for each user session.
70+
71+
1. **Start the services with the `multitenant` profile:**
72+
```bash
73+
docker-compose --profile multitenant up --build
74+
```
75+
76+
2. This command will start the following services:
77+
* `frontend-multitenant`: The Angular application, accessible at `http://localhost:80`.
78+
* `orchestrator-multitenant`: The Node.js orchestrator service (see `src/orchestrator/README.md`). Listens on port `3001` and manages a separate Docker runner instance for each user session (`REUSE_RUNNER_MODE=false` is set for this service in `docker-compose.yml`). It can be configured with the `FREE_DOORS` environment variable to enable arbitrary port (maximum 20) mapping to the runner containers.
79+
* `runner-builder`: This service builds the `runner-image` (see `src/runner/README.md`) and then exits. The `runner-image` includes the necessary configurations for port mapping when `FREE_DOORS` is utilized.
80+
81+
### Singletenant Mode
82+
83+
This mode is simpler and suitable for local development. It uses a single runner instance, managed by the orchestrator service configured appropriately.
84+
85+
1. **Start the services with the `singletenant` profile:**
86+
```bash
87+
docker-compose --profile singletenant up --build
88+
```
89+
90+
2. This command will start the following services:
91+
* `frontend-singletenant`: The Angular application, accessible at `http://localhost:80`.
92+
* `orchestrator-singletenant`: The Node.js orchestrator service. For this profile, it listens on port `3001` and is configured via `docker-compose.yml` to use `REUSE_RUNNER_MODE=true`, meaning it manages a single, shared runner instance for all users.
93+
* `runner-builder`: This service builds the `runner-image` and then exits.
94+
95+
Once the services are running, you can access the application by opening your browser and navigating to `http://localhost:80`.
7496

7597
## Development Scripts
7698

0 commit comments

Comments
 (0)