Fix DB issue 2s

This commit is contained in:
Urtzi Alfaro
2025-09-30 21:58:10 +02:00
parent 147893015e
commit 7cc4b957a5
77 changed files with 4385 additions and 1211 deletions

View File

@@ -1,3 +1,10 @@
# 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
FROM python:3.11-slim
WORKDIR /app
@@ -5,29 +12,27 @@ WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
gcc \
curl \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements and install dependencies
# Copy requirements
COPY services/alert_processor/requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy shared libraries
COPY shared/ /app/shared/
# Copy shared libraries from the shared stage
COPY --from=shared /shared /app/shared
# Copy application code
COPY services/alert_processor/app/ /app/app/
# Copy migrations and alembic config
COPY services/alert_processor/migrations/ /app/migrations/
COPY services/alert_processor/alembic.ini /app/alembic.ini
COPY services/alert_processor/ .
# Copy scripts directory
COPY scripts/ /app/scripts/
# Create non-root user
RUN useradd -m -u 1000 appuser && chown -R appuser:appuser /app
USER appuser
# Add shared libraries to Python path
ENV PYTHONPATH="/app:/app/shared:${PYTHONPATH:-}"
EXPOSE 8000
CMD ["python", "-m", "app.main"]
# Run application (worker service, not a web API)
CMD ["python", "-m", "app.main"]