SaaS/Dockerfile
Claude Code d1b5b72c46 🚀 Transform into full SaaS Automation Platform
Major Update: From simple click counter to comprehensive automation platform

## New Features:
 Full user authentication (register/login/logout)
 SQLite database with user management
 API credentials management system
 Workflow templates library (4 ready-to-use templates)
 User workflow management
 Comprehensive dashboard interface
 Detailed n8n integration instructions
 Security features (bcrypt, sessions, helmet)
 Automated testing suite (14 passing tests)

## Technical Stack:
- Backend: Node.js + Express + SQLite
- Frontend: Vanilla JS + Modern CSS
- Security: bcrypt, express-session, helmet
- Database: SQLite with proper schemas and indexes
- Testing: Mocha + Chai + Supertest

## Templates Included:
1. 📱 Telegram Bot Notifications
2. 📧 Email to Slack Integration
3. 💾 Google Drive Backup Automation
4. 📊 Lead Scoring Automation

## Access Points:
- Legacy app: http://localhost:3000/
- SaaS Platform: http://localhost:3000/dashboard
- API endpoints: /api/*

## Demo Credentials:
- Email: demo@example.com
- Password: demo123

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-29 11:05:29 +01:00

51 lines
No EOL
1.7 KiB
Docker

# Используем Alpine версию Node.js для минимального размера
FROM node:20-alpine AS build
# Устанавливаем рабочую директорию
WORKDIR /app
# Копируем только package.json и package-lock.json для кэширования зависимостей
COPY package*.json ./
# Устанавливаем только production зависимости
RUN npm ci --only=production && npm cache clean --force
# Базовые утилиты для сборки (убрал минификацию для стабильности)
# RUN npm install -g terser html-minifier-terser clean-css-cli
# Копируем остальные файлы
COPY . .
# Удаляем системные файлы macOS
RUN find . -name "._*" -delete || true
# Финальный stage - только runtime
FROM node:20-alpine AS production
# Создаем пользователя для безопасности
RUN addgroup -g 1001 -S nodejs && adduser -S nodeuser -u 1001
WORKDIR /app
# Копируем зависимости из build stage
COPY --from=build /app/node_modules ./node_modules
# Копируем приложение
COPY --from=build /app/server.js ./
COPY --from=build /app/package.json ./
COPY --from=build /app/public ./public
# Меняем владельца файлов
RUN chown -R nodeuser:nodejs /app
USER nodeuser
# Открываем порт
EXPOSE 3000
# Добавляем health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD node -e "require('http').get('http://localhost:3000/health', (res) => { process.exit(res.statusCode === 200 ? 0 : 1) })"
# Запускаем приложение
CMD ["node", "server.js"]