File size: 570 Bytes
ec50620
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Use the official Node.js image with a more recent version
FROM node:20

# Create and change to the app directory.
WORKDIR /usr/src/app

# Copy application dependency manifests to the container image.
COPY package*.json ./

# Install all dependencies (including devDependencies for build)
RUN npm install

# Copy application code and environment variables
COPY . .

# Build the app
RUN npm run build

# Expose the port the app runs on
EXPOSE 3001

# Set environment variable for production
ENV NODE_ENV=production

# Run the server
CMD [ "npm", "run", "start-server" ]