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:
@@ -483,27 +483,47 @@ nim c -d:ssl -d:release -r benchmarks/bench_all.nim
|
||||
|
||||
## Docker Deployment
|
||||
|
||||
### Quick Start with Docker
|
||||
### Quick Start
|
||||
|
||||
```bash
|
||||
docker build -t baradb .
|
||||
docker run -p 9472:9472 -p 9470:9470 -p 9471:9471 -v baradb_data:/data baradb
|
||||
docker build -t baradb:latest .
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
### Docker Compose
|
||||
### Docker Files
|
||||
|
||||
| File | Purpose |
|
||||
|------|---------|
|
||||
| `Dockerfile` | Production-ready image (pre-built binary) |
|
||||
| `Dockerfile.source` | Build from source |
|
||||
| `docker-compose.yml` | Development |
|
||||
| `docker-compose.prod.yml` | Production with TLS, backups, resource limits |
|
||||
| `docker-entrypoint.sh` | Container initialization |
|
||||
|
||||
### Production
|
||||
|
||||
```bash
|
||||
docker-compose up -d
|
||||
docker compose -f docker-compose.prod.yml up -d
|
||||
```
|
||||
|
||||
See [docs/en/docker.md](docs/en/docker.md) for full Docker documentation.
|
||||
|
||||
### Ports
|
||||
|
||||
| Port | Description |
|
||||
|------|-------------|
|
||||
| `9472` | TCP binary protocol |
|
||||
| `9912` | HTTP/REST API (TCP port + 440) |
|
||||
| `9913` | WebSocket (TCP port + 441) |
|
||||
|
||||
### Environment Variables
|
||||
|
||||
| Variable | Default | Description |
|
||||
|----------|---------|-------------|
|
||||
| `BARADB_ADDRESS` | `0.0.0.0` | Bind address |
|
||||
| `BARADB_PORT` | `9472` | TCP binary protocol port |
|
||||
| `BARADB_HTTP_PORT` | `9470` | HTTP/REST API port |
|
||||
| `BARADB_WS_PORT` | `9471` | WebSocket port |
|
||||
| `BARADB_DATA_DIR` | `./data` | Data directory |
|
||||
| `BARADB_DATA_DIR` | `/data` | Data directory |
|
||||
| `BARADB_LOG_LEVEL` | `info` | Log level |
|
||||
| `BARADB_TLS_ENABLED` | `false` | Enable TLS |
|
||||
| `BARADB_CERT_FILE` | — | TLS certificate path |
|
||||
| `BARADB_KEY_FILE` | — | TLS private key path |
|
||||
|
||||
Reference in New Issue
Block a user