tsi-org commited on
Commit
8e12f8b
·
1 Parent(s): 2768c04

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -6
Dockerfile CHANGED
@@ -5,16 +5,16 @@ FROM node:14 AS build
5
  WORKDIR /usr/src/app
6
 
7
  # Copy package.json and package-lock.json for installing dependencies
8
- COPY package.json yarn.lock ./
9
 
10
  # Install dependencies
11
- RUN yarn install
12
 
13
  # Copy the entire project
14
  COPY . .
15
 
16
  # Build the project
17
- RUN yarn build
18
 
19
  # Use a smaller image for the production environment
20
  FROM node:14-alpine
@@ -28,13 +28,13 @@ WORKDIR /usr/src/app
28
  # Copy from the "build" stage
29
  COPY --from=build /usr/src/app/.next ./.next
30
  COPY --from=build /usr/src/app/package.json ./package.json
31
- COPY --from=build /usr/src/app/yarn.lock ./yarn.lock
32
 
33
  # Install only production dependencies
34
- RUN yarn install --production
35
 
36
  # Expose the port the app will run on
37
  EXPOSE 3000
38
 
39
  # Command to run the application
40
- CMD ["yarn", "start"]
 
5
  WORKDIR /usr/src/app
6
 
7
  # Copy package.json and package-lock.json for installing dependencies
8
+ COPY package.json package-lock.json ./
9
 
10
  # Install dependencies
11
+ RUN npm install
12
 
13
  # Copy the entire project
14
  COPY . .
15
 
16
  # Build the project
17
+ RUN npm run build
18
 
19
  # Use a smaller image for the production environment
20
  FROM node:14-alpine
 
28
  # Copy from the "build" stage
29
  COPY --from=build /usr/src/app/.next ./.next
30
  COPY --from=build /usr/src/app/package.json ./package.json
31
+ COPY --from=build /usr/src/app/package-lock.json ./package-lock.json
32
 
33
  # Install only production dependencies
34
+ RUN npm install --production
35
 
36
  # Expose the port the app will run on
37
  EXPOSE 3000
38
 
39
  # Command to run the application
40
+ CMD ["npm", "start"]