Build From Source#
This page covers building the Audio Analyzer microservice from source. Use this path when you need a code change. To run the prebuilt image from Docker Hub without rebuilding, see Run with Docker Compose.
Prerequisites#
Verify the system requirements.
Clone the repository and
cdinto theaudio-analyzer/directory.
Build the Docker Image#
The repository ships a Dockerfile and a docker-compose.yml. The
compose file declares both image: and build: for the service:
docker compose pull && docker compose up -druns the prebuilt image from Docker Hub.docker compose build && docker compose up -drebuilds the result from source and tags as the same${REGISTRY}/audio-analyzer:${RELEASE_TAG}, so subsequentdocker compose upcalls reuse the local build.
docker compose build
docker compose up -d
To build the image directly with docker:
docker build -t audio-analyzer:local .
The Compose setup bind-mounts config.yaml and stores model, chunk,
storage, and Hugging Face cache data in named Docker volumes
(audio_analyzer_{models,chunks,storage,cache}), and passes /dev/dri
through for host Intel iGPU access by default. The container runs as
UID/GID 1000:1000 by default; see
Troubleshooting
if your host user differs.
Build a Python Environment (Standalone)#
Install host packages, then create a virtual environment and install Python dependencies from source:
sudo apt-get update
sudo apt-get install -y ffmpeg alsa-utils libsndfile1
python -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
python main.py
Verifying the Build#
After building and starting the service, confirm:
curl --noproxy '*' http://127.0.0.1:8010/health
A {"status": "ok"} response confirms the build is functional.