# MCP CSS First Server - Dockerfile for cloud deployment
FROM oven/bun:latest AS builder
WORKDIR /app
# Install dependencies
COPY package.json bun.lock* ./
RUN bun install --frozen-lockfile
# Copy source and build
COPY . .
RUN bun run build
# Production stage
FROM oven/bun:latest
WORKDIR /app
# Copy built artifacts
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/package.json ./
# Expose port for HTTP transport (Render sets PORT env var automatically)
EXPOSE 10000
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD bun -e "fetch('http://localhost:' + (process.env.PORT || 10000) + '/health').then(r => process.exit(r.ok ? 0 : 1)).catch(() => process.exit(1))"
# Start server - will use PORT env var if set, otherwise stdio
CMD ["bun", "run", "dist/cli.js"]