first claude draft

This commit is contained in:
buenosairesam
2025-12-29 14:40:06 -03:00
commit 116d4032e2
69 changed files with 5020 additions and 0 deletions

View File

@@ -0,0 +1,47 @@
# Multi-stage Dockerfile for Aggregator service
FROM python:3.11-slim as base
WORKDIR /app
# Install system dependencies including grpc_health_probe
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
&& curl -fsSL https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/v0.4.24/grpc_health_probe-linux-amd64 \
-o /bin/grpc_health_probe \
&& chmod +x /bin/grpc_health_probe \
&& rm -rf /var/lib/apt/lists/*
COPY services/aggregator/requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
COPY shared /app/shared
COPY proto /app/proto
RUN python -m grpc_tools.protoc \
-I/app/proto \
--python_out=/app/shared \
--grpc_python_out=/app/shared \
/app/proto/metrics.proto
COPY services/aggregator /app/services/aggregator
ENV PYTHONPATH=/app
ENV PYTHONUNBUFFERED=1
# =============================================================================
FROM base as development
RUN pip install --no-cache-dir watchfiles
CMD ["python", "-m", "watchfiles", "python services/aggregator/main.py", "/app/services/aggregator"]
# =============================================================================
FROM base as production
RUN useradd --create-home --shell /bin/bash appuser
USER appuser
EXPOSE 50051
CMD ["python", "services/aggregator/main.py"]

View File

@@ -0,0 +1,9 @@
grpcio>=1.60.0
grpcio-tools>=1.60.0
grpcio-health-checking>=1.60.0
redis>=5.0.0
asyncpg>=0.29.0
structlog>=23.2.0
python-json-logger>=2.0.7
pydantic>=2.5.0
pydantic-settings>=2.1.0