Skip to content

Commit 945f97d

Browse files
authored
chore: update docker stack to run HouseWatch locally (#71)
1 parent 6bab56f commit 945f97d

File tree

3 files changed

+49
-2
lines changed

3 files changed

+49
-2
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,16 @@ The following are the supported environment variables for configuring your House
5656

5757
</details>
5858

59+
## 🏡 Running locally
60+
61+
To run HouseWatch locally along with a local ClickHouse instance, execute:
62+
63+
```bash
64+
docker compose -f docker-compose.dev.yml up -d
65+
```
66+
67+
then go to http://localhost:8080
68+
5969
## 💡 Motivation
6070

6171
At PostHog we manage a few large ClickHouse clusters and found ourselves in need of a tool to monitor and manage these more easily.

docker-compose.dev.yml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ services:
1212
CLICKHOUSE_DATABASE: default
1313
CLICKHOUSE_USER: default
1414
CLICKHOUSE_PASSWORD: ""
15-
CLICKHOUSE_CLUSTER: parallel_replicas
15+
CLICKHOUSE_CLUSTER: housewatch
1616
CLICKHOUSE_SECURE: false
1717
CLICKHOUSE_VERIFY: false
1818
CLICKHOUSE_CA: ""
@@ -35,6 +35,25 @@ services:
3535
- redis
3636
- rabbitmq
3737

38+
web:
39+
build:
40+
context: ./frontend
41+
dockerfile: Dockerfile.dev
42+
43+
caddy:
44+
image: caddy:2.6.1
45+
restart: unless-stopped
46+
ports:
47+
- "8080:8080"
48+
- "443:443"
49+
environment:
50+
SITE_ADDRESS: ":8080"
51+
volumes:
52+
- ./docker/Caddyfile:/etc/caddy/Caddyfile
53+
depends_on:
54+
- web
55+
- app
56+
3857
db:
3958
image: postgres:14-alpine
4059
restart: on-failure
@@ -47,6 +66,8 @@ services:
4766
test: ["CMD-SHELL", "pg_isready -U housewatch"]
4867
interval: 5s
4968
timeout: 5s
69+
ports:
70+
- "5432:5432"
5071

5172
redis:
5273
image: redis:6.2.7-alpine
@@ -68,12 +89,14 @@ services:
6889
- rabbitmq
6990

7091
clickhouse:
71-
image: ${CLICKHOUSE_SERVER_IMAGE:-clickhouse/clickhouse-server:23.4.2.11}
92+
image: ${CLICKHOUSE_SERVER_IMAGE:-clickhouse/clickhouse-server:23.12.5}
7293
restart: on-failure
7394
depends_on:
7495
- zookeeper
7596
volumes:
7697
- ./docker/clickhouse-server/config.d:/etc/clickhouse-server/config.d
98+
ports:
99+
- "8123:8123"
77100

78101
zookeeper:
79102
image: zookeeper:3.7.0

frontend/Dockerfile.dev

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM node:20.4.0-alpine
2+
3+
ENV PNPM_HOME="/pnpm"
4+
ENV PATH="$PNPM_HOME:$PATH"
5+
6+
RUN corepack enable
7+
8+
WORKDIR /frontend
9+
10+
COPY . .
11+
12+
RUN pnpm i
13+
14+
CMD ["pnpm", "vite", "--port", "3000", "--host"]

0 commit comments

Comments
 (0)