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:
+42
-9
@@ -1,23 +1,56 @@
|
||||
version: "3.9"
|
||||
# BaraDB — Development Docker Compose
|
||||
# Usage: docker compose up -d
|
||||
|
||||
services:
|
||||
baradb:
|
||||
build: .
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
image: baradb:latest
|
||||
container_name: baradb-dev
|
||||
hostname: baradb
|
||||
restart: unless-stopped
|
||||
|
||||
ports:
|
||||
- "9000:9000"
|
||||
- "9470:9470"
|
||||
- "9471:9471"
|
||||
- "9472:9472" # Binary protocol
|
||||
- "9912:9912" # HTTP/REST API
|
||||
- "9913:9913" # WebSocket
|
||||
|
||||
volumes:
|
||||
- baradb_data:/data
|
||||
# Монтираме WAL директорията отделно за по-добра производителност (по желание)
|
||||
# - baradb_wal:/data/server/wal
|
||||
|
||||
environment:
|
||||
- BARADB_PORT=9000
|
||||
- BARADB_ADDRESS=0.0.0.0
|
||||
- BARADB_PORT=9472
|
||||
- BARADB_DATA_DIR=/data
|
||||
- BARADB_HTTP_PORT=9470
|
||||
- BARADB_WS_PORT=9471
|
||||
- BARADB_LOG_LEVEL=debug
|
||||
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "-q", "--spider", "http://localhost:9470/health"]
|
||||
test: ["CMD", "sh", "-c", "wget -qO- http://localhost:9912/health >/dev/null 2>&1"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
start_period: 15s
|
||||
|
||||
# Development resource limits (по-леки)
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '2.0'
|
||||
memory: 2G
|
||||
reservations:
|
||||
cpus: '0.5'
|
||||
memory: 256M
|
||||
|
||||
networks:
|
||||
- baradb_net
|
||||
|
||||
volumes:
|
||||
baradb_data:
|
||||
driver: local
|
||||
|
||||
networks:
|
||||
baradb_net:
|
||||
driver: bridge
|
||||
|
||||
Reference in New Issue
Block a user