# Build From Source This page covers building the Audio Analyzer microservice from source for both Docker and standalone host execution. ## Prerequisites - Verify the [System Requirements](./system-requirements.md). - Clone the repository and `cd` into the `audio_analyzer/` directory. ## Build the Docker Image The repository ships a `Dockerfile` and a `docker-compose.yml`. To build the image as part of the Compose stack: ```bash docker compose build docker compose up -d ``` To build the image directly with `docker`: ```bash docker build -t audio-analyzer:local . ``` The Compose setup mounts `config.yaml`, `models/`, `chunks/`, `storage/`, and the Hugging Face cache into the container, and passes `/dev/dri` through for host Intel iGPU access by default. The container runs as UID/GID `1000:1000` by default; see [Troubleshooting](../troubleshooting.md#permission-errors-on-mounted-folders) if your host user differs. Fresh clones include placeholder files for the expected mount roots. If you remove those directories and then start Compose, Docker may recreate the missing host paths as `root` before the container starts. ## Build a Python Environment (Standalone) Install host packages, then create a virtual environment and install Python dependencies from source: ```bash 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: ```bash curl --noproxy '*' http://127.0.0.1:8010/health ``` A `{"status": "ok"}` response confirms the build is functional.