# ═══════════════════════════════════════════════════════════ # 🐍 OPHION - Python Instrumented App Dockerfile # Example showing how to add OpenTelemetry to any Python app # ═══════════════════════════════════════════════════════════ FROM python:3.12-slim WORKDIR /app # Install dependencies COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Install OpenTelemetry auto-instrumentation RUN pip install --no-cache-dir \ opentelemetry-distro \ opentelemetry-exporter-otlp \ opentelemetry-instrumentation # Auto-install all available instrumentations RUN opentelemetry-bootstrap -a install # Copy application code COPY . . # Expose port EXPOSE 5000 # Start with auto-instrumentation wrapper # opentelemetry-instrument auto-configures tracing based on env vars CMD ["opentelemetry-instrument", "python", "app.py"]