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 \
|
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
|
|
# Copy requirements and install dependencies
|
|
|
|
|
COPY services/alert_processor/requirements.txt .
|
|
|
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
|
|
|
|
|
|
# Copy shared libraries
|
|
|
|
|
COPY shared/ /app/shared/
|
|
|
|
|
|
|
|
|
|
# Copy application code
|
|
|
|
|
COPY services/alert_processor/app/ /app/app/
|
|
|
|
|
|
2025-09-30 13:32:51 +02:00
|
|
|
# Copy migrations and alembic config
|
|
|
|
|
COPY services/alert_processor/migrations/ /app/migrations/
|
|
|
|
|
COPY services/alert_processor/alembic.ini /app/alembic.ini
|
|
|
|
|
|
|
|
|
|
# Copy scripts directory
|
|
|
|
|
COPY scripts/ /app/scripts/
|
|
|
|
|
|
2025-08-23 10:19:58 +02:00
|
|
|
# Create non-root user
|
|
|
|
|
RUN useradd -m -u 1000 appuser && chown -R appuser:appuser /app
|
|
|
|
|
USER appuser
|
|
|
|
|
|
|
|
|
|
EXPOSE 8000
|
|
|
|
|
|
|
|
|
|
CMD ["python", "-m", "app.main"]
|