-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
104 lines (76 loc) · 2.56 KB
/
Copy pathDockerfile
File metadata and controls
104 lines (76 loc) · 2.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# ============================================
# PolyGen AI - Development Dockerfile
# Multi-stage build for local development
# ============================================
# Stage 1: Base image with Node.js and pnpm
FROM node:20-alpine AS base
# Install pnpm globally
RUN corepack enable && corepack prepare pnpm@9 --activate
# Set working directory
WORKDIR /app
# Install dependencies for native modules
RUN apk add --no-cache python3 make g++ git
# ============================================
# Stage 2: Development dependencies
# ============================================
FROM base AS deps
# Copy package files
COPY package.json pnpm-lock.yaml* ./
# Install all dependencies (including devDependencies)
RUN pnpm install --frozen-lockfile
# ============================================
# Stage 3: Development server
# ============================================
FROM base AS development
# Set development environment
ENV NODE_ENV=development
ENV VITE_HOST=0.0.0.0
ENV VITE_PORT=3000
WORKDIR /app
# Copy dependencies from deps stage
COPY --from=deps /app/node_modules ./node_modules
# Copy source code
COPY . .
# Expose development server port
EXPOSE 3000
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:3000/ || exit 1
# Start development server with hot reload
CMD ["pnpm", "dev", "--host", "0.0.0.0"]
# ============================================
# Stage 4: Production build
# ============================================
FROM base AS builder
WORKDIR /app
# Copy dependencies
COPY --from=deps /app/node_modules ./node_modules
# Copy source code
COPY . .
# Build the application
ARG GEMINI_API_KEY
ARG GEMINI_MODEL=gemini-3-pro-preview
ARG CODER_MODEL=claude-sonnet-4-20250514
ARG THINKING_LEVEL=high
ARG USE_MULTI_AGENT=true
ENV GEMINI_API_KEY=$GEMINI_API_KEY
ENV GEMINI_MODEL=$GEMINI_MODEL
ENV CODER_MODEL=$CODER_MODEL
ENV THINKING_LEVEL=$THINKING_LEVEL
ENV USE_MULTI_AGENT=$USE_MULTI_AGENT
RUN pnpm build
# ============================================
# Stage 5: Production server (optional - for self-hosting)
# ============================================
FROM nginx:alpine AS production
# Copy custom nginx config
COPY docker/nginx.conf /etc/nginx/nginx.conf
# Copy built assets from builder
COPY --from=builder /app/dist /usr/share/nginx/html
# Expose port
EXPOSE 80
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:80/ || exit 1
# Start nginx
CMD ["nginx", "-g", "daemon off;"]