cd46edcb67
CI / test (push) Has been cancelled
CI / verify (push) Has been cancelled
Clients CI / build-server (push) Has been cancelled
Clients CI / test-python (push) Has been cancelled
Clients CI / test-javascript (push) Has been cancelled
Clients CI / test-nim (push) Has been cancelled
Clients CI / test-rust (push) Has been cancelled
Storage fixes: - Fix bloom filter hash2 OverflowDefect (uint64 instead of int Hash) - Fix MemTable.put size calculation on overwrite (was leaking size) - Fix fuzz_test duplicate-key issues in LSM delete and SSTable tests Test fixes: - Fix stress_test.nim: replace deprecated threadpool with std/threads - Fix fuzz_test.nim: add missing imports (tables, algorithm, sets) - Fix fuzz_test.nim: var sst for close() compatibility - Remove unused imports from test_all.nim and bench_all.nim Docker / CI fixes: - Fix Dockerfile.source: invalid nimlang/nim:2.2.10-alpine tag → 2.2.10 + ubuntu:24.04 runtime - Fix Dockerfile.source healthcheck (--spider → -qO- for 200 OK) - Fix Dockerfile run comment ports (9470/9471 → 9912/9913) - Fix scripts/docker-run.sh healthcheck port (9470 → 9912) - Add ARG BUILD_DATE/VCS_REF to Dockerfile for docker-build.sh - Update all version strings 1.1.4 → 1.1.6 across nimble/docker/source/docs
90 lines
3.4 KiB
Docker
90 lines
3.4 KiB
Docker
# ┌─────────────────────────────────────────────────────────┐
|
||
# │ BaraDB — Multimodal Database Engine │
|
||
# │ Dockerfile.source (build from source) │
|
||
# └─────────────────────────────────────────────────────────┘
|
||
#
|
||
# Този Dockerfile build-ва BaraDB от source код.
|
||
# ВНИМАНИЕ: Изисква локален nimble пакет (hunos), който
|
||
# не е в публичния nimble repository. Преди build трябва да:
|
||
# 1. symlink-нете или копирате hunos/ в проекта, или
|
||
# 2. копирате ~/.nimble/pkgs2 в builder стейджа.
|
||
#
|
||
# Build:
|
||
# docker build -f Dockerfile.source -t baradb:latest .
|
||
|
||
# ─── Stage 1: Builder ─────────────────────────────────────
|
||
FROM nimlang/nim:2.2.10 AS builder
|
||
|
||
WORKDIR /build
|
||
|
||
# Копираме nimble файл и инсталираме публични зависимости
|
||
COPY baradadb.nimble .
|
||
RUN nimble install -d -y || true
|
||
|
||
# Копираме целия изходен код
|
||
COPY src/ src/
|
||
COPY *.nim .
|
||
|
||
# Компилираме release binary
|
||
# Забележка: Ако липсват локални пакети (hunos), този ред ще се провали.
|
||
RUN nim c -d:release --opt:speed -d:ssl -o:baradadb src/baradadb.nim
|
||
|
||
# Компилираме backup tool
|
||
RUN nim c -d:release --path:src -o:backup src/barabadb/core/backup.nim
|
||
|
||
# ─── Stage 2: Production Runtime ──────────────────────────
|
||
FROM ubuntu:24.04
|
||
|
||
LABEL maintainer="BaraDB Team"
|
||
LABEL description="BaraDB — Multimodal Database Engine (source build)"
|
||
LABEL version="1.1.6"
|
||
|
||
# Инсталираме runtime зависимости
|
||
RUN apt-get update && \
|
||
apt-get install -y --no-install-recommends \
|
||
libpcre3 \
|
||
ca-certificates \
|
||
wget \
|
||
gosu && \
|
||
rm -rf /var/lib/apt/lists/*
|
||
|
||
# Създаваме dedicated потребител за сигурност
|
||
RUN groupadd -r baradb && \
|
||
useradd -r -g baradb baradb
|
||
|
||
WORKDIR /app
|
||
|
||
# Копираме компилираните бинарни файлове
|
||
COPY --from=builder /build/baradadb /app/baradadb
|
||
COPY --from=builder /build/backup /app/backup
|
||
|
||
# Копираме entrypoint скрипта
|
||
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
|
||
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
|
||
|
||
# Създаваме data директория и symlink за съвместимост с default dataDir=./data
|
||
RUN mkdir -p /data && chown baradb:baradb /data && \
|
||
ln -s /data /app/data && chown -h baradb:baradb /app/data
|
||
|
||
# Environment variables (defaults)
|
||
ENV BARADB_ADDRESS=0.0.0.0
|
||
ENV BARADB_PORT=9472
|
||
# Note: HTTP port = TCP port + 440 (9912 when TCP=9472)
|
||
# Note: WS port = TCP port + 441 (9913 when TCP=9472)
|
||
ENV BARADB_DATA_DIR=/data
|
||
ENV BARADB_LOG_LEVEL=info
|
||
|
||
# Expose ports
|
||
EXPOSE 9472 9912 9913
|
||
|
||
# Volume за persistent data
|
||
VOLUME ["/data"]
|
||
|
||
# Healthcheck
|
||
HEALTHCHECK --interval=15s --timeout=5s --start-period=10s --retries=3 \
|
||
CMD wget -qO- http://localhost:9912/health >/dev/null 2>&1 || exit 1
|
||
|
||
# Стартираме чрез entrypoint
|
||
ENTRYPOINT ["docker-entrypoint.sh"]
|
||
CMD ["./baradadb"]
|