# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
# Use Node.js LTS version as the base image
FROM node:18-alpine AS builder
# Set the working directory
WORKDIR /app
# Copy package.json and package-lock.json to the working directory
COPY package.json package-lock.json ./
# Install dependencies
RUN npm install --ignore-scripts
# Copy the rest of the application code to the working directory
COPY . .
# Build the TypeScript files
RUN npm run build
# Use a clean Node.js image for the production environment
FROM node:18-alpine AS release
# Set the working directory
WORKDIR /app
# Copy built files and node_modules from the builder stage
COPY --from=builder /app/build ./build
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package.json ./
# Set environment variables (replace YOUR_API_KEY_HERE with the actual key)
ENV PERPLEXITY_API_KEY=YOUR_API_KEY_HERE
# Expose the port the app runs on
EXPOSE 3000
# Command to run the application
ENTRYPOINT ["node", "build/index.js"]