Add Audio Processor service Dockerfile

This commit is contained in:
2025-07-14 00:25:36 -05:00
parent 6373381f00
commit 24cacc851c

View File

@ -0,0 +1,36 @@
FROM python:3.11-slim
# Install system dependencies
RUN apt-get update && apt-get install -y \
ffmpeg \
libopus0 \
libopus-dev \
pkg-config \
gcc \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy requirements first for better Docker layer caching
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy source code
COPY src/ ./src/
# Create necessary directories
RUN mkdir -p /app/audio/raw /app/audio/processed /app/logs
# Run as non-root user
RUN useradd -m -u 1001 processor
RUN chown -R processor:processor /app
USER processor
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD python src/healthcheck.py || exit 1
# Start the service
CMD ["python", "src/processor.py"]