# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
# Use the official Node.js 18 image
FROM node:18-alpine AS builder
# Create app directory
WORKDIR /app
# Copy package.json and package-lock.json
COPY package.json package-lock.json ./
# Install app dependencies
RUN npm install
# Copy the application code
COPY src ./src
COPY tsconfig.json ./
# Build the application
RUN npm run build
# Use a new stage to reduce the size of the final image
FROM node:18-alpine
WORKDIR /app
# Copy only the necessary files from the build stage
COPY --from=builder /app/dist /app/dist
COPY --from=builder /app/package.json /app/package.json
# Set environment variables
ENV NODE_ENV=production
# The environment variables for Redmine
ENV REDMINE_HOST=https://your-redmine.example.com
ENV REDMINE_API_KEY=your-api-key-here
# Start the server
CMD ["node", "dist/index.js"]