Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update docker stack to run HouseWatch locally #71

Merged
merged 3 commits into from
Jul 3, 2024
Merged
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
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@ The following are the supported environment variables for configuring your House

</details>

## 🏡 Running locally

To run HouseWatch locally along with a local ClickHouse instance, execute:

```bash
docker compose -f docker-compose.dev.yml up -d
```

then go to http://localhost:8080

## 💡 Motivation

At PostHog we manage a few large ClickHouse clusters and found ourselves in need of a tool to monitor and manage these more easily.
Expand Down
27 changes: 25 additions & 2 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ services:
CLICKHOUSE_DATABASE: default
CLICKHOUSE_USER: default
CLICKHOUSE_PASSWORD: ""
CLICKHOUSE_CLUSTER: parallel_replicas
CLICKHOUSE_CLUSTER: housewatch
CLICKHOUSE_SECURE: false
CLICKHOUSE_VERIFY: false
CLICKHOUSE_CA: ""
Expand All @@ -35,6 +35,25 @@ services:
- redis
- rabbitmq

web:
build:
context: ./frontend
dockerfile: Dockerfile.dev

caddy:
image: caddy:2.6.1
restart: unless-stopped
ports:
- "8080:8080"
- "443:443"
environment:
SITE_ADDRESS: ":8080"
volumes:
- ./docker/Caddyfile:/etc/caddy/Caddyfile
depends_on:
- web
- app

db:
image: postgres:14-alpine
restart: on-failure
Expand All @@ -47,6 +66,8 @@ services:
test: ["CMD-SHELL", "pg_isready -U housewatch"]
interval: 5s
timeout: 5s
ports:
- "5432:5432"

redis:
image: redis:6.2.7-alpine
Expand All @@ -68,12 +89,14 @@ services:
- rabbitmq

clickhouse:
image: ${CLICKHOUSE_SERVER_IMAGE:-clickhouse/clickhouse-server:23.4.2.11}
image: ${CLICKHOUSE_SERVER_IMAGE:-clickhouse/clickhouse-server:23.12.5}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch!

restart: on-failure
depends_on:
- zookeeper
volumes:
- ./docker/clickhouse-server/config.d:/etc/clickhouse-server/config.d
ports:
- "8123:8123"

zookeeper:
image: zookeeper:3.7.0
Expand Down
14 changes: 14 additions & 0 deletions frontend/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM node:20.4.0-alpine

ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"

RUN corepack enable

WORKDIR /frontend

COPY . .

RUN pnpm i

CMD ["pnpm", "vite", "--port", "3000", "--host"]
Loading