mirror of
https://github.com/CopilotKit/CopilotKit.git
synced 2026-09-14 16:26:20 +08:00
43 lines
1.0 KiB
Docker
43 lines
1.0 KiB
Docker
# Stage 1: Build Next.js frontend
|
|
FROM node:20-slim AS frontend
|
|
WORKDIR /app
|
|
RUN corepack enable
|
|
COPY package.json ./
|
|
RUN pnpm install --no-frozen-lockfile
|
|
COPY . .
|
|
RUN pnpm build
|
|
|
|
# Stage 2: Production image with Node.js + Python
|
|
FROM python:3.12-slim AS runner
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
curl && \
|
|
curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
|
|
apt-get install -y nodejs && \
|
|
npm install -g corepack && \
|
|
corepack enable && \
|
|
apt-get clean && rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /app
|
|
|
|
# Python dependencies
|
|
COPY requirements.txt ./
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Next.js build artifacts
|
|
COPY --from=frontend /app/.next ./.next
|
|
COPY --from=frontend /app/node_modules ./node_modules
|
|
COPY --from=frontend /app/package.json ./
|
|
|
|
# Agent code + config
|
|
COPY langgraph.json ./
|
|
COPY src/agents/ ./src/agents/
|
|
|
|
# Entrypoint
|
|
COPY entrypoint.sh ./
|
|
RUN chmod +x entrypoint.sh
|
|
|
|
EXPOSE 10000
|
|
ENV NODE_ENV=production
|
|
ENV PORT=10000
|
|
CMD ["./entrypoint.sh"]
|