forked from Open-Dev-Society/OpenStock
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (24 loc) · 698 Bytes
/
Dockerfile
File metadata and controls
31 lines (24 loc) · 698 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
# Use official Node.js 20 Alpine image as base
FROM node:20-alpine
# Set working directory
WORKDIR /app
# Copy package.json and package-lock.json to leverage Docker cache
COPY package*.json ./
# Uncomment the next line if you use pnpm and have pnpm-lock.yaml
# COPY pnpm-lock.yaml ./
# Install dependencies (choose npm or pnpm)
RUN npm install
# If using pnpm, replace with:
# RUN npm install -g pnpm && pnpm install
# Copy all project files
COPY . .
# Build the Next.js application
RUN npm run build
# Or if using pnpm:
# RUN pnpm run build
# Expose the port Next.js runs on
EXPOSE 3000
# Start the Next.js production server
CMD ["npm", "start"]
# Or if using pnpm:
# CMD ["pnpm", "start"]