bardd commited on
Commit
4700c58
·
verified ·
1 Parent(s): 7ed8457

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -10
Dockerfile CHANGED
@@ -6,21 +6,21 @@ RUN apk add --no-cache make gcc g++ python3
6
  # Create app directory
7
  WORKDIR /app
8
 
9
- # Install app dependencies
10
- COPY package*.json ./
 
 
 
11
 
12
  # Install dependencies
13
- RUN npm install
14
 
15
- # Install additional dependencies
16
- RUN npm install mongoose bcrypt jsonwebtoken @nestjs/passport @nestjs/jwt passport-jwt passport-custom jwt-decode passport-local uuid i18n-ts
17
 
18
- # Rebuild bcrypt
19
  RUN npm rebuild bcrypt --build-from-source
20
 
21
- # Bundle app source
22
- COPY . .
23
-
24
  # Create the dist directory and set permissions
25
  RUN mkdir -p /app/dist && chown -R node:node /app
26
 
@@ -31,4 +31,4 @@ USER node
31
  EXPOSE 7860
32
 
33
  # Command to run the application
34
- CMD ["npm", "run", "start:dev"]
 
6
  # Create app directory
7
  WORKDIR /app
8
 
9
+ # Copy all application files
10
+ COPY . .
11
+
12
+ # Remove existing node_modules (if any)
13
+ RUN rm -rf node_modules
14
 
15
  # Install dependencies
16
+ RUN npm ci
17
 
18
+ # Build the application
19
+ RUN npm run build
20
 
21
+ # Rebuild bcrypt (if necessary)
22
  RUN npm rebuild bcrypt --build-from-source
23
 
 
 
 
24
  # Create the dist directory and set permissions
25
  RUN mkdir -p /app/dist && chown -R node:node /app
26
 
 
31
  EXPOSE 7860
32
 
33
  # Command to run the application
34
+ CMD ["npm", "run", "start:dev"]