Add Docker deployment support with compose, entrypoint and docs

- Add Dockerfile (pre-built binary) and Dockerfile.source
- Add docker-compose.yml, docker-compose.prod.yml, docker-compose.override.yml
- Add docker-entrypoint.sh with non-root user support
- Add .dockerignore and helper scripts (scripts/docker-build.sh, scripts/docker-run.sh)
- Add docs/en/docker.md with full Docker guide
- Update docs/en/deployment.md and README.md
- Fix src/barabadb/core/config.nim to read BARADB_ADDRESS, BARADB_PORT, BARADB_DATA_DIR from env
- Fix src/barabadb/core/httpserver.nim missing wire import
This commit is contained in:
2026-05-06 23:58:43 +03:00
parent 9b7ed1fca8
commit b6cdf8c88e
14 changed files with 764 additions and 80 deletions
+16
View File
@@ -1,3 +1,6 @@
import std/os
import std/strutils
type
BaraConfig* = object
address*: string
@@ -37,3 +40,16 @@ proc defaultConfig*(): BaraConfig =
proc loadConfig*(): BaraConfig =
result = defaultConfig()
# Docker / Environment overrides
let envAddress = getEnv("BARADB_ADDRESS", "")
if envAddress.len > 0:
result.address = envAddress
let envPort = getEnv("BARADB_PORT", "")
if envPort.len > 0:
try:
result.port = parseInt(envPort)
except ValueError:
discard
let envDataDir = getEnv("BARADB_DATA_DIR", "")
if envDataDir.len > 0:
result.dataDir = envDataDir
+1
View File
@@ -15,6 +15,7 @@ import ../query/parser
import ../query/executor
import ../storage/lsm
import ../core/mvcc
import ../protocol/wire
import ../protocol/ratelimit
import ../core/websocket
import jwt as jwtlib