Skip to content

Commit

Permalink
docs: docs on selfhosting trench
Browse files Browse the repository at this point in the history
  • Loading branch information
christianmat committed Oct 24, 2024
1 parent 6d346e4 commit 5933bd6
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 20 deletions.
2 changes: 1 addition & 1 deletion apps/docs/mint.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"navigation": [
{
"group": "Getting Started",
"pages": ["introduction", "quickstart"]
"pages": ["introduction", "quickstart", "self-host"]
},
{
"group": "API",
Expand Down
59 changes: 59 additions & 0 deletions apps/docs/self-host.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
title: Self-host Trench
sidebarTitle: Self-host
description: Host Trench on your own infrastructure
---

## Self-Hosting Trench

Trench can be self-hosted on your own infrastructure using a single Docker image. The image comes bundled with both Clickhouse and Kafka and requires no additional dependencies.

### Prerequisites

To run the Trench Docker image, we recommend a system with the following specifications:

- At least 4 CPU cores
- At least 8GB of RAM

These specifications ensure optimal performance for your Trench instance.

### Getting Started

To start the server, first clone the Trench repository, navigate to the `apps/trench` directory.

```bash
git clone https://github.com/frigadehq/trench
cd apps/trench
```

Next, create a `.env` file. You can use the example below as a template, but make sure to replace the placeholder values with your own:

```bash
NODE_ENV=production
API_PORT=80
API_HTTPS=false
CLICKHOUSE_USER=user
CLICKHOUSE_PASSWORD=password
CLICKHOUSE_DATABASE=default
CLICKHOUSE_HOST=clickhouse
CLICKHOUSE_PORT=8123
KAFKA_BROKERS=kafka:9092
KAFKA_TOPIC=trench_events
KAFKA_PARTITIONS=1
PUBLIC_API_KEYS=my-public-api-key
PRIVATE_API_KEYS=my-private-api-key
```

You can now start the server in production mode with the following command. It may take a few minutes to start up:

```bash
docker-compose up --build --force-recreate --renew-anon-volumes -d
```

Once the server is running, you can open up a browser and navigate to `http://localhost:80`. You should see the following message:

```
Trench server is running
```

You can now test out the system end to end by following the [Quickstart](/quickstart) guide.
19 changes: 0 additions & 19 deletions apps/trench/README.md

This file was deleted.

0 comments on commit 5933bd6

Please sign in to comment.