# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
# Use an official Node.js runtime as the base image
FROM node:20-alpine AS builder
# Set the working directory
WORKDIR /app
# Copy the package.json and pnpm-lock.yaml files
COPY package.json pnpm-lock.yaml ./
# Install pnpm
RUN npm install -g pnpm
# Install the dependencies
RUN pnpm install
# Copy the source code
COPY . .
# Build the TypeScript files
RUN pnpm run build
# Use a new Node.js image for the final stage
FROM node:20-alpine
# Set the working directory
WORKDIR /app
# Copy the built files and node_modules from the builder stage
COPY --from=builder /app/dist /app/dist
COPY --from=builder /app/node_modules /app/node_modules
COPY --from=builder /app/package.json /app/package.json
# Set the environment variables
ENV GOOGLE_CLIENT_EMAIL="your-service-account@project.iam.gserviceaccount.com"
ENV GOOGLE_PRIVATE_KEY="your-private-key"
ENV GA_PROPERTY_ID="your-ga4-property-id"
# Start the server
CMD ["node", "dist/index.js"]