FROM node:20-slim WORKDIR /app # Copy package files COPY package*.json ./ # Install all dependencies (including devDependencies for build) RUN npm ci # Copy source code COPY tsconfig.json ./ COPY src/ ./src/ # Build TypeScript RUN npx tsc # Remove devDependencies after build RUN npm prune --production # Hugging Face Spaces uses port 7860 ENV PORT=7860 ENV NODE_ENV=production EXPOSE 7860 # Start the server CMD ["node", "dist/server.js"]