-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
57 lines (42 loc) · 1.34 KB
/
Dockerfile
File metadata and controls
57 lines (42 loc) · 1.34 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
# Dockerfile for VibeShift Frontend
# Multi-stage build for production
# Stage 1: Dependencies
FROM node:22-alpine AS deps
RUN apk add --no-cache libc6-compat
WORKDIR /app
# Copy package files
COPY package.json pnpm-lock.yaml* ./
RUN npm i -g pnpm && pnpm install --frozen-lockfile
# Stage 2: Builder
FROM node:22-alpine AS builder
WORKDIR /app
# Install pnpm globally (needed for build)
RUN npm i -g pnpm
COPY --from=deps /app/node_modules ./node_modules
COPY / ./
# Build arguments for API keys (will be embedded in the build)
ARG VITE_OPENROUTER_API_KEY
ARG VITE_GEMINI_API_KEY
ARG VITE_COPILOT_API_KEY
ENV VITE_OPENROUTER_API_KEY=${VITE_OPENROUTER_API_KEY}
ENV VITE_GEMINI_API_KEY=${VITE_GEMINI_API_KEY}
ENV VITE_COPILOT_API_KEY=${VITE_COPILOT_API_KEY}
# Build the application
RUN pnpm build
# Stage 3: Production runner (nginx)
FROM nginx:alpine AS production
WORKDIR /usr/share/nginx/html
# Install curl for healthcheck
RUN apk add --no-cache curl
# Remove default nginx configuration
RUN rm /etc/nginx/conf.d/default.conf
# Copy custom nginx configuration
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Copy built application (copy contents of dist, not the dist folder itself)
COPY --from=builder /app/dist/ ./
# Set proper permissions
RUN chmod -R 755 /usr/share/nginx/html
# Expose port
EXPOSE 80
# Start nginx
CMD ["nginx", "-g", "daemon off;"]