Get hlquery running in Docker!
hlquery is a high-performance search engine written in C++ designed for fast full-text search and semantic search capabilities.
- Docker installed and running
- Docker Compose installed (usually included with Docker)
- Port 9200 available, or set
HOST_PORTto publish on a different host port
The easiest way to install and run hlquery:
cd docker
docker-compose up -dThis will:
- Clone the hlquery source code from GitHub
- Build the Docker image
- Start hlquery on
http://localhost:9200
If port 9200 is already in use on the host:
HOST_PORT=9201 docker-compose up -dThis keeps hlquery listening on port 9200 inside the container while publishing it as http://localhost:9201 on the host.
Verify it's running (replace 9200 if you set HOST_PORT):
curl http://localhost:9200/healthAlternatively, use the automated bootstrap script:
cd docker
./bootstrap.shThe bootstrap script will build and start hlquery automatically.
-
Navigate to the docker directory:
$ cd docker -
Start hlquery:
$ docker-compose up -d
-
Check status:
$ docker-compose ps $ docker-compose logs -f
Stop hlquery:
docker-compose down-
Build the image:
$ cd docker $ docker build --build-arg VERSION=unstable -t hlquery:latest .
-
Run the container:
docker run -d \ --name hlquery \ -p 9200:9200 \ -v hlquery_data:/var/lib/hlquery \ -v hlquery_logs:/var/log/hlquery \ hlquery:latest
-
Check status:
$ docker ps $ docker logs hlquery
Stop hlquery:
$ docker stop hlquery
$ docker rm hlqueryConfigure hlquery using environment variables:
| Variable | Default | Description |
|---|---|---|
HLQUERY_PORT |
9200 |
Port to listen on |
HLQUERY_DATA_DIR |
/var/lib/hlquery |
Directory for data storage |
HLQUERY_LOG_DIR |
/var/log/hlquery |
Directory for log files |
HLQUERY_CONF_DIR |
/etc/hlquery/conf |
Directory for configuration files |
The Docker image builds from https://github.com/hlquery/hlquery and defaults to the unstable branch. Override VERSION if you want a different branch, tag, or commit.
Example - Change port:
docker run -d \
--name hlquery \
-p 8080:8080 \
-e HLQUERY_PORT=8080 \
hlquery:latestMount your configuration directory:
Docker Compose:
volumes:
- ./conf:/etc/hlquery/confDocker command:
docker run -d \
--name hlquery \
-p 9200:9200 \
-v /path/to/your/config:/etc/hlquery/conf \
hlquery:latestNote: The container runs as user hlquery (UID 1000). Ensure your config directory has correct permissions.
Set environment variables when starting Compose:
HOST_PORT=8080 HLQUERY_PORT=9200 docker-compose up -dIf you also want the service to listen on a different port inside the container:
HOST_PORT=8080 HLQUERY_PORT=8080 docker-compose up -dcd docker
docker build -t hlquery:latest .docker build \
--build-arg VERSION=latest \
--build-arg BUILD_MODE=release \
--build-arg WITH_JEMALLOC=0 \
-t hlquery:latest .| Argument | Options | Default | Description |
|---|---|---|---|
VERSION |
latest, main, 1.0.0, v1.0.0, branch/tag |
latest |
Git version to build |
BUILD_MODE |
release, debug, profile, sanitize |
release |
Build configuration |
WITH_JEMALLOC |
0, 1 |
0 |
Enable jemalloc allocator |
WITH_TCMALLOC |
0, 1 |
0 |
Enable tcmalloc allocator |
hlquery uses Docker volumes for persistent storage:
| Volume | Mount Point | Description |
|---|---|---|
hlquery_data |
/var/lib/hlquery |
Collection data and indexes |
hlquery_logs |
/var/log/hlquery |
Log files |
hlquery_conf |
/etc/hlquery/conf |
Configuration files |
Docker Compose automatically creates named volumes. Data persists across container restarts.
Mount host directories directly:
docker run -d \
--name hlquery \
-p 9200:9200 \
-v /host/data:/var/lib/hlquery \
-v /host/logs:/var/log/hlquery \
hlquery:latest# Docker Compose
$ docker-compose ps
# Docker
$ docker ps | grep hlquery$ curl http://localhost:${HOST_PORT:-9200}/health# Docker Compose
$ docker-compose logs -f
# Docker
$ docker logs -f hlquery# Start
$ docker-compose up -d
# Stop
$ docker-compose down
# Restart
$ docker-compose restart# Docker Compose
$ docker-compose exec hlquery /bin/bash
# Docker
$ docker exec -it hlquery /bin/bash-
Pull latest code (if using a specific version):
# Edit docker-compose.yml to change VERSION build arg -
Rebuild and restart:
$ docker-compose build $ docker-compose up -d
Check logs:
$ docker-compose logs
# or
$ docker logs hlqueryCommon issues:
- Port already in use: Change port in
docker-compose.ymlor use-pflag - Permission denied: Ensure volumes have correct permissions (UID 1000)
- Out of disk space: Clean up with
docker system prune
- Verify container is running:
docker ps - Check port mapping:
docker port hlquery - Test from inside container:
docker exec hlquery curl http://localhost:9200/health - Check firewall settings
- Check container logs:
docker logs hlquery - Manually test:
docker exec hlquery hlquery-cli status - Increase startup time in
docker-compose.yml:healthcheck: start_period: 60s
For production, consider:
- Use specific image tags instead of
latest - Set resource limits (CPU, memory)
- Use external volumes for better performance
- Configure log rotation
- Set up monitoring and alerts
See the Production Deployment section in the full documentation for detailed examples.
- API Documentation: See main project README
- Configuration Guide: See
conf/README.mdfor configuration examples - Docker Documentation: docs.docker.com
Search beyond keywords - Happy searching!
