-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile.frontend
More file actions
30 lines (21 loc) · 827 Bytes
/
Dockerfile.frontend
File metadata and controls
30 lines (21 loc) · 827 Bytes
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
# ---------------------------------------------------------------------------
# Agent Economy — Frontend Dockerfile
# Multi-stage: Node.js builder + nginx for production serving
# ---------------------------------------------------------------------------
# Stage 1: Build
FROM node:20-alpine AS builder
WORKDIR /app
# Install dependencies first (layer caching — only re-runs on package.json change)
COPY frontend/package.json frontend/package-lock.json* ./
RUN npm install
# Copy the full frontend source and build
COPY frontend/ .
RUN npm run build
# Stage 2: Serve with nginx
FROM nginx:alpine
# Copy built assets from builder stage
COPY --from=builder /app/dist /usr/share/nginx/html
# Copy custom nginx configuration
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]