-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.binary
More file actions
47 lines (36 loc) · 1.65 KB
/
Copy pathDockerfile.binary
File metadata and controls
47 lines (36 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Optimized Dockerfile using pre-built binaries
# This avoids compilation entirely - just copies the right binary
FROM ubuntu:24.04
# Automatically selects the right architecture
ARG TARGETARCH
# Install minimal runtime dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends ca-certificates curl && \
rm -rf /var/lib/apt/lists/*
# Create non-root user (UID 1001 to avoid conflict with ubuntu:24.04 default user)
RUN useradd -m -u 1001 chronik || useradd -m chronik
# Copy the pre-built binary for the target architecture
# Expects binaries in artifacts/linux/{amd64,arm64}/chronik-server
COPY artifacts/linux/${TARGETARCH}/chronik-server /usr/local/bin/chronik-server
# Ensure binary is executable and create data directory
RUN chmod +x /usr/local/bin/chronik-server && \
mkdir -p /data && \
chown chronik:chronik /data
# Switch to non-root user
USER chronik
# Data volume
VOLUME ["/data"]
# Expose ports:
# 9092 — Kafka protocol
# 6092 — Unified API (SQL, vector search, Elasticsearch-compat search, admin)
# 13092 — Prometheus metrics (default single-node port = 13000 + node_id=92)
EXPOSE 9092 6092 13092
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD nc -z localhost 9092 || exit 1
# Run the server (v2.2.0+ CLI: `start` auto-detects single-node vs cluster mode).
# IMPORTANT: set CHRONIK_ADVERTISE (or pass --advertise) when running so Kafka
# clients receive a reachable address instead of 0.0.0.0:
# docker run -e CHRONIK_ADVERTISE=my-hostname ghcr.io/lspecian/chronik-stream:latest
ENTRYPOINT ["chronik-server"]
CMD ["start", "--bind", "0.0.0.0", "--data-dir", "/data"]