Skip to content

Commit 0bc511e

Browse files
Add Docker support with bundled ClickHouse server
1 parent d6ff723 commit 0bc511e

6 files changed

Lines changed: 123 additions & 2 deletions

File tree

.dockerignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules
2+
dist
3+
.git
4+
*.md
5+
.static

Dockerfile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Build stage
2+
FROM node:20-alpine AS builder
3+
WORKDIR /app
4+
COPY package*.json ./
5+
RUN npm ci
6+
COPY . .
7+
RUN npm run build
8+
9+
# Runtime stage
10+
FROM clickhouse/clickhouse-server:latest
11+
12+
# Install nginx and supervisor
13+
RUN apt-get update && apt-get install -y nginx supervisor && rm -rf /var/lib/apt/lists/*
14+
15+
# Copy built frontend
16+
COPY --from=builder /app/dist /var/www/html
17+
18+
# Copy nginx config (proxies /clickhouse to ClickHouse)
19+
COPY docker/nginx.conf /etc/nginx/nginx.conf
20+
21+
# Copy ClickHouse user config (read-only viewer user)
22+
COPY docker/users.xml /etc/clickhouse-server/users.d/viewer.xml
23+
24+
# Copy supervisor config (runs both nginx and ClickHouse)
25+
COPY docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
26+
27+
# Expose only web port (ClickHouse internal only)
28+
EXPOSE 80
29+
30+
# Start supervisor (manages nginx + ClickHouse)
31+
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]

README.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# RowBinary Visualizer
22

3-
A web-based tool for visualizing ClickHouse RowBinary data, similar to ImHex. Features an interactive hex viewer with AST-based type visualization.
3+
A web-based tool for visualizing ClickHouse RowBinary data, similar to ImHex. Features an interactive hex viewer with AST-based type visualization. 100% vibecoded with Claude Code.
44

55
![Screenshot](.static/screenshot.png)
66

@@ -11,7 +11,20 @@ A web-based tool for visualizing ClickHouse RowBinary data, similar to ImHex. Fe
1111
- **Interactive Highlighting**: Selecting a node in the tree highlights corresponding bytes in the hex view (and vice versa)
1212
- **Full Type Support**: All ClickHouse types including Variant, Dynamic, JSON, Geo types, Nested, etc.
1313

14-
## Setup
14+
## Quick Start (Docker)
15+
16+
Run with bundled ClickHouse server:
17+
18+
```bash
19+
docker build -t rowbinary-explorer .
20+
docker run -d -p 8080:80 rowbinary-explorer
21+
```
22+
23+
Open http://localhost:8080
24+
25+
## Development Setup
26+
27+
For local development (requires ClickHouse at `localhost:8123`):
1528

1629
```bash
1730
npm install

docker/nginx.conf

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
events {
2+
worker_connections 1024;
3+
}
4+
5+
http {
6+
include /etc/nginx/mime.types;
7+
default_type application/octet-stream;
8+
9+
server {
10+
listen 80;
11+
server_name localhost;
12+
root /var/www/html;
13+
index index.html;
14+
15+
# Serve static files
16+
location / {
17+
try_files $uri $uri/ /index.html;
18+
}
19+
20+
# Proxy /clickhouse to ClickHouse server
21+
location /clickhouse {
22+
rewrite ^/clickhouse(.*) $1 break;
23+
proxy_pass http://127.0.0.1:8123;
24+
proxy_set_header Host $host;
25+
proxy_set_header X-Real-IP $remote_addr;
26+
27+
# Use the read-only viewer user
28+
proxy_set_header X-ClickHouse-User viewer;
29+
proxy_set_header X-ClickHouse-Key "";
30+
}
31+
}
32+
}

docker/supervisord.conf

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[supervisord]
2+
nodaemon=true
3+
user=root
4+
5+
[program:clickhouse]
6+
command=/entrypoint.sh
7+
autostart=true
8+
autorestart=true
9+
stdout_logfile=/dev/stdout
10+
stdout_logfile_maxbytes=0
11+
stderr_logfile=/dev/stderr
12+
stderr_logfile_maxbytes=0
13+
14+
[program:nginx]
15+
command=/usr/sbin/nginx -g "daemon off;"
16+
autostart=true
17+
autorestart=true
18+
stdout_logfile=/dev/stdout
19+
stdout_logfile_maxbytes=0
20+
stderr_logfile=/dev/stderr
21+
stderr_logfile_maxbytes=0

docker/users.xml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0"?>
2+
<clickhouse>
3+
<users>
4+
<viewer>
5+
<password></password>
6+
<networks>
7+
<ip>::/0</ip>
8+
</networks>
9+
<profile>readonly</profile>
10+
<quota>default</quota>
11+
<access_management>0</access_management>
12+
</viewer>
13+
</users>
14+
<profiles>
15+
<readonly>
16+
<readonly>1</readonly>
17+
</readonly>
18+
</profiles>
19+
</clickhouse>

0 commit comments

Comments
 (0)