mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-24 22:04:56 +00:00
- Remove outdated documentation files from root and docs/ - Clean up generated workflow and audit documentation - Complete fakemui migration in workflowui - Remove remaining SCSS modules - Update package dependencies across all packages - Reorganize documentation structure Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
71 lines
1.9 KiB
Docker
71 lines
1.9 KiB
Docker
# Multi-stage build for WorkflowUI
|
|
# Stage 1: Backend (Python Flask)
|
|
FROM python:3.9-slim as backend-builder
|
|
|
|
WORKDIR /app/backend
|
|
|
|
COPY workflowui/backend/requirements.txt .
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
gcc \
|
|
&& rm -rf /var/lib/apt/lists/* \
|
|
&& pip install --no-cache-dir -r requirements.txt
|
|
|
|
COPY workflowui/backend/ .
|
|
|
|
# Stage 2: Frontend (Node.js + Next.js)
|
|
FROM node:18-alpine as frontend-builder
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy package files
|
|
COPY workflowui/package*.json ./
|
|
RUN npm install --legacy-peer-deps
|
|
|
|
# Copy source code
|
|
COPY workflowui/ .
|
|
# Copy fakemui for imports
|
|
COPY fakemui/ ../fakemui
|
|
|
|
# Build Next.js application
|
|
RUN npm run build
|
|
|
|
# Stage 3: Runtime (Combined)
|
|
FROM node:18-alpine
|
|
|
|
WORKDIR /app
|
|
|
|
# Install Python runtime for backend
|
|
RUN apk add --no-cache python3 py3-pip gcc musl-dev linux-headers
|
|
|
|
# Copy frontend from builder
|
|
COPY --from=frontend-builder /app/node_modules ./node_modules
|
|
COPY --from=frontend-builder /app/.next ./.next
|
|
COPY --from=frontend-builder /app/public ./public
|
|
COPY --from=frontend-builder /app/package.json ./package.json
|
|
COPY --from=frontend-builder /app/next.config.js ./next.config.js
|
|
|
|
# Copy backend from builder
|
|
COPY --from=backend-builder /app/backend ./backend
|
|
|
|
# Install Python backend dependencies
|
|
RUN pip install --no-cache-dir --break-system-packages -r backend/requirements.txt
|
|
|
|
# Create data directory for SQLite
|
|
RUN mkdir -p /app/data /app/logs
|
|
|
|
# Environment variables
|
|
ENV NODE_ENV=production
|
|
ENV PYTHONUNBUFFERED=1
|
|
ENV DATABASE_URL=sqlite:////app/data/workflows.db
|
|
ENV FLASK_APP=backend/server_sqlalchemy.py
|
|
|
|
# Expose ports
|
|
EXPOSE 3000 5000
|
|
|
|
# Health check
|
|
HEALTHCHECK --interval=30s --timeout=5s --retries=3 \
|
|
CMD wget --quiet --tries=1 --spider http://localhost:3000/api/health || exit 1
|
|
|
|
# Start both services
|
|
CMD ["sh", "-c", "python3 backend/server_sqlalchemy.py & npm start"]
|