-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (22 loc) · 755 Bytes
/
Dockerfile
File metadata and controls
32 lines (22 loc) · 755 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
31
32
# Stage 1: Build the application
FROM node:18-alpine AS builder
# Install pnpm
RUN npm install -g pnpm
WORKDIR /app
# Copy dependency definition files
COPY package.json pnpm-lock.yaml ./
# Install dependencies
RUN pnpm install --frozen-lockfile
# Copy the rest of the application code
COPY . .
# Build the application
# Replace 'build' with your actual build script if different (e.g., 'export', 'generate')
RUN pnpm build
# Stage 2: Serve the application with Nginx
FROM nginx:alpine
# Copy built assets from the builder stage
# Adjust '/app/dist' if your build output directory is different (e.g., /app/build, /app/out, /app/.next)
COPY --from=builder /app/dist /usr/share/nginx/html
EXPOSE 80
# Start Nginx
CMD ["nginx", "-g", "daemon off;"]