40 lines
2.1 KiB
Docker
40 lines
2.1 KiB
Docker
# syntax=docker/dockerfile:1
|
|
# ─────────────────────────────────────────────────────────────────────────────
|
|
# Sanad Package 1 — Basic Communication.
|
|
# BUILD CONTEXT MUST BE Packages/ (FROM the prebuilt sanad-base):
|
|
# docker build -f Sanad_Package_1/Dockerfile -t sanad-p1:latest .
|
|
# (the top-level Packages/docker-compose.yml sets context: . for this service.)
|
|
# ─────────────────────────────────────────────────────────────────────────────
|
|
ARG BASE_IMAGE=sanad-base:latest
|
|
FROM ${BASE_IMAGE}
|
|
|
|
# P1 (comms) extra system deps — PortAudio + a C toolchain so pyaudio's C
|
|
# extension compiles on the slim base (python:3.10-slim has no compiler).
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
portaudio19-dev libportaudio2 build-essential python3-dev \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# P1 Python deps (sanad-base is python:3.10 → google-genai installs cleanly).
|
|
COPY Sanad_Package_1/requirements-p1.txt /tmp/requirements-p1.txt
|
|
RUN python3 -m pip install --no-cache-dir -r /tmp/requirements-p1.txt
|
|
|
|
# P1 launcher + routes + entrypoint + config (Sanad source baked into sanad-base).
|
|
COPY Sanad_Package_1/app_p1.py /app/app_p1.py
|
|
COPY Sanad_Package_1/routes_p1.py /app/routes_p1.py
|
|
COPY Sanad_Package_1/entrypoint.sh /app/entrypoint.sh
|
|
COPY Sanad_Package_1/config /app/pkg1_config
|
|
COPY Sanad_Package_1/static /app/pkg1_static
|
|
RUN chmod +x /app/entrypoint.sh
|
|
|
|
# Ship KEYLESS — strip any Gemini key baked into the Sanad config so the vendor
|
|
# key never ships in the image; the customer adds their own via the dashboard.
|
|
COPY Sanad_Package_1/strip_key.py /tmp/strip_key.py
|
|
RUN python3 /tmp/strip_key.py && rm -f /tmp/strip_key.py
|
|
|
|
ENV SANAD_PACKAGE=P1 \
|
|
SANAD_DASHBOARD_PORT=8011 \
|
|
SANAD_DASHBOARD_HOST=0.0.0.0 \
|
|
SANAD_P1_STATIC=/app/pkg1_static
|
|
EXPOSE 8011
|
|
ENTRYPOINT ["/app/entrypoint.sh"]
|