Files
bakery-ia/services/alert_processor/Dockerfile

39 lines
876 B
Docker
Raw Normal View History

2025-09-30 21:58:10 +02:00
# Alert Processor Dockerfile
# Add this stage at the top of each service Dockerfile
FROM python:3.11-slim AS shared
WORKDIR /shared
COPY shared/ /shared/
# Then your main service stage
2025-08-23 10:19:58 +02:00
FROM python:3.11-slim
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
gcc \
2025-09-30 21:58:10 +02:00
curl \
2025-08-23 10:19:58 +02:00
&& rm -rf /var/lib/apt/lists/*
2025-09-30 21:58:10 +02:00
# Copy requirements
2025-08-23 10:19:58 +02:00
COPY services/alert_processor/requirements.txt .
2025-09-30 21:58:10 +02:00
# Install Python dependencies
2025-08-23 10:19:58 +02:00
RUN pip install --no-cache-dir -r requirements.txt
2025-09-30 21:58:10 +02:00
# Copy shared libraries from the shared stage
COPY --from=shared /shared /app/shared
2025-08-23 10:19:58 +02:00
# Copy application code
2025-09-30 21:58:10 +02:00
COPY services/alert_processor/ .
2025-09-30 13:32:51 +02:00
# Copy scripts directory
COPY scripts/ /app/scripts/
2025-09-30 21:58:10 +02:00
# Add shared libraries to Python path
ENV PYTHONPATH="/app:/app/shared:${PYTHONPATH:-}"
2025-08-23 10:19:58 +02:00
2025-09-30 21:58:10 +02:00
# Run application (worker service, not a web API)
CMD ["python", "-m", "app.main"]