# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
# Start with a Node.js image
FROM node:16-alpine AS builder
# Create and change to the app directory
WORKDIR /app
# Copy package.json and package-lock.json
COPY package.json ./
# Install dependencies without running scripts
RUN npm install --ignore-scripts
# Copy the rest of the application code
COPY . .
# Build the TypeScript code
RUN npm run build
# Final stage: use a minimal Node.js runtime
FROM node:16-alpine
# Set the working directory in the container
WORKDIR /app
# Copy compiled JavaScript files from the builder
COPY --from=builder /app/dist /app/dist
# Copy package.json to the container
COPY package.json .
# Set environment variable for the API key
ENV ALPHA_VANTAGE_API_KEY=your_api_key_here
# Install only production dependencies
RUN npm ci --omit=dev
# Start the application
ENTRYPOINT ["node", "dist/index.js"]