File tree Expand file tree Collapse file tree 3 files changed +33
-1
lines changed Expand file tree Collapse file tree 3 files changed +33
-1
lines changed Original file line number Diff line number Diff line change
1
+ FROM node:18-alpine
2
+
3
+ WORKDIR /app
4
+
5
+ COPY package.json .
6
+
7
+ RUN npm install
8
+ RUN npm run build
9
+
10
+ COPY . .
11
+
12
+ EXPOSE 4000
13
+
14
+ CMD ["node" , "app.js" ]
Original file line number Diff line number Diff line change 24
24
},
25
25
"scripts" : {
26
26
"start" : " DISABLE_ESLINT_PLUGIN=true react-scripts start" ,
27
- "build" : " react-scripts build" ,
27
+ "build" : " DISABLE_ESLINT_PLUGIN=true react-scripts build" ,
28
28
"test" : " react-scripts test" ,
29
29
"eject" : " react-scripts eject"
30
30
},
Original file line number Diff line number Diff line change
1
+ const express = require ( 'express' ) ;
2
+ const path = require ( 'path' ) ;
3
+
4
+ const app = express ( ) ;
5
+ const port = process . env . PORT || 4000 ;
6
+
7
+ // Serve static files from the build folder
8
+ app . use ( express . static ( path . join ( __dirname , 'build' ) ) ) ;
9
+
10
+ // Handle requests to the root URL
11
+ app . get ( '/' , ( req , res ) => {
12
+ res . sendFile ( path . join ( __dirname , 'build' , 'index.html' ) ) ;
13
+ } ) ;
14
+
15
+ // Start the server
16
+ app . listen ( port , ( ) => {
17
+ console . log ( `Server is running on port ${ port } ` ) ;
18
+ } ) ;
You can’t perform that action at this time.
0 commit comments