# ============================================================================
# MASTER CLOUD RUN TRACKER DOCKERFILE - L10 ARCHITECT PARTNER SPEC
# ============================================================================
# This Dockerfile builds a lightweight, secure, and high-performance container
# for your Node.js/Express analytics tracking proxy on Google Cloud Run.
# ============================================================================

# 1. Use the official lightweight Node.js 20 LTS slim image
FROM node:20-slim

# 2. Set the working directory inside the container
WORKDIR /usr/src/app

# 3. Copy package.json and package-lock.json (if present) to utilize layer caching
COPY package*.json ./

# 4. Install only production dependencies to keep the image extremely small
RUN npm install --only=production

# 5. Copy the rest of your application code
COPY . .

# 6. Expose Port 8080 (Google Cloud Run's default routing port)
EXPOSE 8080

# 7. Start the tracking application
CMD [ "node", "index.js" ]
