feat: Phase 6 — Docker + docker-compose + backup/restore CLI

- Dockerfile: multi-stage build (nim:alpine -> alpine), env-configurable
- docker-compose.yml: single node with volume + healthcheck
- backup.nim: backup/restore tar.gz snapshots, list/cleanup
- CLI: baradadb backup|restore|list --data-dir=DIR
- All 216 tests pass
This commit is contained in:
2026-05-06 11:39:18 +03:00
parent 3cdec95143
commit 10ab464a43
3 changed files with 143 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
FROM nim:2.2-alpine AS builder
WORKDIR /build
COPY baradadb.nimble .
COPY src/ src/
RUN nimble install -d -y || true
RUN nim c -d:release --opt:speed -o:baradadb src/baradadb.nim
FROM alpine:latest
WORKDIR /app
COPY --from=builder /build/baradadb .
RUN mkdir -p /data
ENV BARADB_PORT=9000
ENV BARADB_DATA_DIR=/data
ENV BARADB_HTTP_PORT=8080
ENV BARADB_WS_PORT=8081
EXPOSE 9000 8080 8081
VOLUME ["/data"]
CMD ["./baradadb"]