diff options
| author | Fuwn <[email protected]> | 2026-01-28 03:14:59 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-01-28 03:14:59 -0800 |
| commit | 87b4dbee77a7dc84f3916af8f38f8863c18e2cc7 (patch) | |
| tree | 5def489830caa63fb526c4587f659901277c48bd | |
| parent | feat: Add SSE streaming for instant page load and real-time updates (diff) | |
| download | kaze-main.tar.xz kaze-main.zip | |
go-libsql includes pre-compiled Rust libraries built against glibc.
Alpine uses musl libc which is incompatible (undefined mmap64, fstat64).
| -rw-r--r-- | Dockerfile | 19 |
1 files changed, 9 insertions, 10 deletions
@@ -1,10 +1,10 @@ -# Build stage -FROM golang:1.24-alpine AS builder +# Build stage - using Debian for glibc compatibility with go-libsql +FROM golang:1.24-bookworm AS builder WORKDIR /app # Install build dependencies -RUN apk add --no-cache git +RUN apt-get update && apt-get install -y --no-install-recommends git ca-certificates && rm -rf /var/lib/apt/lists/* # Copy go mod files COPY go.mod go.sum ./ @@ -14,23 +14,23 @@ RUN go mod download COPY . . # Build the binary with version info -RUN CGO_ENABLED=0 GOOS=linux go build \ +RUN CGO_ENABLED=1 GOOS=linux go build \ -ldflags="-s -w \ -X main.version=$(git describe --tags --always --dirty 2>/dev/null || echo dev) \ -X main.commit=$(git rev-parse --short HEAD 2>/dev/null || echo none) \ -X main.date=$(date -u +%Y-%m-%dT%H:%M:%SZ)" \ -o kaze ./cmd/kaze -# Runtime stage -FROM alpine:3.19 +# Runtime stage - using Debian slim for glibc compatibility +FROM debian:bookworm-slim WORKDIR /app -# Install CA certificates for HTTPS requests -RUN apk add --no-cache ca-certificates tzdata +# Install CA certificates and timezone data +RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates tzdata wget && rm -rf /var/lib/apt/lists/* # Create non-root user -RUN adduser -D -u 1000 kaze +RUN useradd -r -u 1000 -m kaze # Create data directory before switching user RUN mkdir -p /app/data && chown -R kaze:kaze /app @@ -49,6 +49,5 @@ HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \ CMD wget --no-verbose --tries=1 --spider http://localhost:8080/ || exit 1 # Run the application -# Config and database will be in /app/data volume mount ENTRYPOINT ["./kaze"] CMD ["--config", "/app/data/config.yaml"] |