-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
38 lines (26 loc) · 677 Bytes
/
Dockerfile
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
# ---- Build Stage ----
FROM node:22-alpine AS builder
# Set working directory
WORKDIR /app
# Copy package.json and package-lock.json
COPY package*.json ./
# Install dependencies
RUN npm ci
# Copy the rest of the app's source code
COPY . ./
# Build the application
RUN npm run build
# ---- Run Stage ----
FROM node:22-alpine
WORKDIR /app
# Copy package.json and package-lock.json
COPY package*.json ./
# Install production dependencies
RUN npm ci --only=production
# Copy build files from builder stage
COPY --from=builder /app/.next ./.next
COPY --from=builder /app/public ./public
# Expose the listening port
EXPOSE 3000
# Run the application
CMD ["npm", "start"]