File tree Expand file tree Collapse file tree 2 files changed +14
-15
lines changed Expand file tree Collapse file tree 2 files changed +14
-15
lines changed Original file line number Diff line number Diff line change 1
- FROM node:latest as build
1
+ FROM node:18-alpine
2
2
3
- WORKDIR /app
3
+ WORKDIR /app
4
4
5
- COPY package.json package-lock.json ./
5
+ # Copy package.json and package-lock.json
6
+ COPY package*.json /
6
7
7
- RUN npm install
8
+ # Install dependencies
9
+ RUN npm ci
8
10
9
- COPY . ./
11
+ # Copy the rest of the code
12
+ COPY . .
10
13
11
- RUN npm run build
14
+ # Build the app
15
+ RUN npm run build
12
16
17
+ # Expose the port the app runs on
18
+ EXPOSE 3000
13
19
14
- FROM nginx:alpine
15
-
16
- COPY --from=build /app/build /usr/share/nginx/html
17
-
18
- EXPOSE 80
19
-
20
- CMD ["nginx" , "-g" , "daemon off;" ]
20
+ # Start the application
21
+ CMD ["npm" , "run" ,"start" ]
Original file line number Diff line number Diff line change @@ -11,5 +11,3 @@ services:
11
11
- " 8081:3000"
12
12
volumes :
13
13
- .:/app
14
- stdin_open : true
15
- tty : true
You can’t perform that action at this time.
0 commit comments