Skip to main content
Glama
Dockerfile1.11 kB
# Multi-stage Docker build for NestJS application FROM node:18-alpine AS builder # Set working directory WORKDIR /app # Copy package files COPY package*.json ./ COPY pnpm-lock.yaml ./ # Install pnpm RUN npm install -g pnpm # Install dependencies RUN pnpm install --frozen-lockfile # Copy source code COPY . . # Build application RUN pnpm run build # Production stage FROM node:18-alpine AS production # Set working directory WORKDIR /app # Install pnpm RUN npm install -g pnpm # Copy package files COPY package*.json ./ COPY pnpm-lock.yaml ./ # Install production dependencies only RUN pnpm install --frozen-lockfile --production # Copy built application from builder stage COPY --from=builder /app/dist ./dist # Create non-root user RUN addgroup -g 1001 -S nodejs RUN adduser -S nestjs -u 1001 # Change ownership of the app directory RUN chown -R nestjs:nodejs /app USER nestjs # Expose port EXPOSE 3001 # Health check HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ CMD curl -f http://localhost:3001/health || exit 1 # Start application CMD ["node", "dist/main"]

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/zaizaizhao/mcp-swagger-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server