Files
A-Team-Security-Infra-Agent…/backend/Dockerfile
nogueiraguh 19e481275d feat: Terraform resource reference from provider schema, provider alias fixes, and timestamps
- Add gen_tf_reference.py to generate OCI Terraform provider resource catalog (~937 resources) from `terraform providers schema -json`
- Auto-inject categorized resource reference into Terraform Agent system prompt to prevent invalid resource type names
- Build-time reference generation in Dockerfile, refreshable via POST /api/terraform/refresh-reference
- Provider alias detection with brace-matching parser for multi-region deployments
- Clean old .tf files before writing new ones on Re-plan
- Message timestamps in terraform chat and history
- Partial DOM rendering to eliminate screen flickering
- Layout overflow fix (no scroll beyond viewport)
2026-03-08 01:00:47 -03:00

33 lines
990 B
Docker

FROM python:3.12-slim
WORKDIR /app
# Install system deps + Terraform CLI
RUN apt-get update && apt-get install -y --no-install-recommends \
curl gcc libffi-dev unzip && \
ARCH=$(dpkg --print-architecture) && \
curl -fsSL "https://releases.hashicorp.com/terraform/1.7.5/terraform_1.7.5_linux_${ARCH}.zip" -o /tmp/tf.zip && \
unzip /tmp/tf.zip -d /usr/local/bin/ && rm /tmp/tf.zip && \
rm -rf /var/lib/apt/lists/*
# Install Python deps + OCI CLI
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt && \
pip install --no-cache-dir oci-cli
# Copy app
COPY app.py .
COPY cis_reports.py .
COPY mcp_cis_server.py .
COPY gen_tf_reference.py .
# Data volume
RUN mkdir -p /data
# Generate OCI Terraform resource reference at build time
RUN python gen_tf_reference.py || echo "WARN: tf reference generation skipped (terraform init may need network)"
EXPOSE 8000
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "8"]