91 lines
1.9 KiB
YAML
91 lines
1.9 KiB
YAML
services:
|
|
# Production service
|
|
herodb-prod:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
container_name: herodb-production
|
|
restart: unless-stopped
|
|
ports:
|
|
- "6379:6379"
|
|
- "8080:8080"
|
|
volumes:
|
|
- herodb-data:/data
|
|
# Optional: Unix socket for IPC
|
|
- herodb-ipc:/tmp
|
|
environment:
|
|
- RUST_LOG=${RUST_LOG:-info}
|
|
command: >
|
|
--dir /data
|
|
--port 6379
|
|
--admin-secret ${ADMIN_SECRET}
|
|
--enable-rpc
|
|
--rpc-port 8080
|
|
--enable-rpc-ipc
|
|
--rpc-ipc-path /tmp/herodb.ipc
|
|
healthcheck:
|
|
test: ["CMD", "timeout", "2", "bash", "-c", "</dev/tcp/localhost/6379"]
|
|
interval: 30s
|
|
timeout: 3s
|
|
retries: 3
|
|
start_period: 5s
|
|
networks:
|
|
- herodb-network
|
|
|
|
# Development service
|
|
herodb-dev:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile.dev
|
|
container_name: herodb-development
|
|
ports:
|
|
- "6380:6379" # Different port to avoid conflicts
|
|
- "8081:8080"
|
|
volumes:
|
|
- ./:/app
|
|
- cargo-cache:/usr/local/cargo/registry
|
|
- target-cache:/app/target
|
|
- herodb-dev-data:/data
|
|
environment:
|
|
- RUST_LOG=debug
|
|
- RUST_BACKTRACE=1
|
|
command: >
|
|
cargo run --
|
|
--dir /data
|
|
--port 6379
|
|
--admin-secret ${ADMIN_SECRET:-devsecret}
|
|
--enable-rpc
|
|
--rpc-port 8080
|
|
--debug
|
|
stdin_open: true
|
|
tty: true
|
|
networks:
|
|
- herodb-network
|
|
|
|
# Optional: Redis CLI for testing
|
|
redis-cli:
|
|
image: redis:7-alpine
|
|
container_name: herodb-cli
|
|
command: redis-cli -h herodb-prod -p 6379
|
|
depends_on:
|
|
- herodb-prod
|
|
networks:
|
|
- herodb-network
|
|
profiles:
|
|
- tools
|
|
|
|
volumes:
|
|
herodb-data:
|
|
driver: local
|
|
herodb-dev-data:
|
|
driver: local
|
|
herodb-ipc:
|
|
driver: local
|
|
cargo-cache:
|
|
driver: local
|
|
target-cache:
|
|
driver: local
|
|
|
|
networks:
|
|
herodb-network:
|
|
driver: bridge |