File size: 660 Bytes
fb70fce
 
 
f50ecb4
 
 
2764350
 
fb70fce
f50ecb4
 
fb70fce
 
 
 
 
 
 
 
 
 
f50ecb4
 
 
fb70fce
9cc6a57
fb70fce
 
 
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
# Use the official Node.js 18 image as the base
FROM node:18

# Set working directory
WORKDIR /app

# Create a new user with a unique UID and switch to it
RUN useradd -m -u 1001 user

# Switch to root user to install dependencies
USER root

# Copy package.json and package-lock.json first (for efficient caching)
COPY --chown=user ./package.json ./package-lock.json ./

# Install dependencies (including dev dependencies)
RUN npm install --no-cache

# Copy the rest of the application files
COPY --chown=user . .

# Switch back to non-root user
USER user

# Expose the port the app runs on
EXPOSE 3001

# Start the development server
CMD ["npm", "run", "dev"]