brainy/examples/brainy-service-template/Dockerfile
David Snelling ee003a9473 feat: add zero-configuration Brainy service template with augmentation-first architecture
- Implement WebSocket augmentation for real-time communication
- Implement WebRTC augmentation for peer-to-peer connections
- Implement HTTP augmentation as minimal REST fallback
- Add auto-discovery augmentation for data pattern analysis
- Add adaptive storage augmentation for intelligent resource management
- Add environment adapter augmentation for universal compatibility
- Template auto-detects environment (browser, Node.js, serverless, containers)
- Intelligent transport selection (WebRTC → WebSocket → HTTP)
- Automatic storage optimization (memory → filesystem → S3)
- Zero configuration required - just npm start
- Includes intelligent verb scoring by default
- Works in any environment without configuration
- Full documentation and examples included
2025-08-06 18:17:32 -07:00

44 lines
No EOL
871 B
Docker

FROM node:24-alpine
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apk add --no-cache \
python3 \
make \
g++ \
git
# Copy package files
COPY package*.json ./
# Install dependencies
RUN npm ci --only=production
# Download Brainy models for offline operation
RUN npm run download-models
# Copy application code
COPY . .
# Create logs directory
RUN mkdir -p logs
# Create non-root user
RUN addgroup -g 1001 -S nodejs && \
adduser -S brainy -u 1001 -G nodejs
# Change ownership
RUN chown -R brainy:nodejs /app
USER brainy
# Expose port
EXPOSE 3000
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
CMD node -e "fetch('http://localhost:3000/health/liveness').then(r=>r.ok?process.exit(0):process.exit(1)).catch(()=>process.exit(1))"
# Start the application
CMD ["npm", "start"]