bardd commited on
Commit
14f69c6
·
verified ·
1 Parent(s): eca71ed

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -9
Dockerfile CHANGED
@@ -1,25 +1,24 @@
1
  FROM node:20-alpine
2
 
3
- # Set working directory
4
  WORKDIR /app
5
 
6
- # Copy package.json and package-lock.json
7
  COPY package*.json ./
8
 
9
- # Install dependencies
10
  RUN npm install
11
 
12
- # Copy the rest of your application code
13
  COPY . .
14
 
15
- # Change ownership of the /app directory to the node user
16
- RUN chown -R node:node /app
17
 
18
- # Switch to the node user
19
  USER node
20
 
21
- # Expose the port your app runs on
22
  EXPOSE 7860
23
 
24
- # Command to run your app in development mode
25
  CMD ["npm", "run", "start:dev"]
 
1
  FROM node:20-alpine
2
 
3
+ # Create app directory
4
  WORKDIR /app
5
 
6
+ # Install app dependencies
7
  COPY package*.json ./
8
 
 
9
  RUN npm install
10
 
11
+ # Bundle app source
12
  COPY . .
13
 
14
+ # Create the dist directory and set permissions
15
+ RUN mkdir -p /app/dist && chown -R node:node /app
16
 
17
+ # Switch to non-root user
18
  USER node
19
 
20
+ # Expose the port the app runs on
21
  EXPOSE 7860
22
 
23
+ # Command to run the application
24
  CMD ["npm", "run", "start:dev"]