diff --git a/services/audio-processor/Dockerfile b/services/audio-processor/Dockerfile new file mode 100644 index 0000000..fa7c860 --- /dev/null +++ b/services/audio-processor/Dockerfile @@ -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"]