FROM python:3.12-slim # Environment defaults (can be overridden at runtime) ENV PYTHONUNBUFFERED=1 \ HOMEKIT_NAME="Home Automation Bridge" \ HOMEKIT_PIN="031-45-154" \ HOMEKIT_PORT="51826" \ API_BASE="http://api:8001" \ HOMEKIT_API_TOKEN="" \ HOMEKIT_PERSIST_FILE="/data/homekit.state" WORKDIR /app # Copy only requirements first for better build caching COPY apps/homekit/requirements.txt ./apps/homekit/requirements.txt RUN pip install --no-cache-dir --upgrade pip \ && pip install --no-cache-dir -r apps/homekit/requirements.txt # Copy full source tree COPY . /app # Expose HomeKit TCP port (mDNS uses UDP 5353 via host network) EXPOSE 51826/tcp # Volume for persistent HomeKit state (pairings etc.) VOLUME ["/data"] # Start the HomeKit bridge CMD ["python", "-m", "apps.homekit.main"]