# ═══════════════════════════════════════════════════════════
# 🐍 OPHION - Node.js Instrumented App Dockerfile
# Example showing how to add OpenTelemetry to any Node.js app
# ═══════════════════════════════════════════════════════════

FROM node:20-alpine

WORKDIR /app

# Copy package files
COPY package*.json ./

# Install dependencies + OpenTelemetry auto-instrumentation
RUN npm install && \
    npm install @opentelemetry/auto-instrumentations-node \
                @opentelemetry/api \
                @opentelemetry/sdk-node \
                @opentelemetry/exporter-trace-otlp-http \
                @opentelemetry/exporter-metrics-otlp-http

# Copy application code
COPY . .

# Expose port
EXPOSE 3000

# Start with auto-instrumentation
# The NODE_OPTIONS env var in docker-compose.yml handles instrumentation
CMD ["node", "server.js"]
