File tree 3 files changed +29
-0
lines changed
3 files changed +29
-0
lines changed Original file line number Diff line number Diff line change
1
+ .git
2
+ node_modules
3
+ build
Original file line number Diff line number Diff line change
1
+ # Build Stage -> Packaging up the React Project to be Served by Nginx
2
+ FROM node:alpine as builder
3
+ WORKDIR /app
4
+ COPY . ./
5
+ RUN npm install
6
+ RUN npm run build
7
+
8
+ # Serve Stage -> Serving the built React content
9
+ FROM nginx:alpine
10
+ COPY nginx/nginx.conf /etc/nginx/conf.d/default.conf
11
+ COPY --from=builder /app/build /usr/share/nginx/html
12
+ EXPOSE 80
13
+ CMD ["nginx" , "-g" , "daemon off;" ]
Original file line number Diff line number Diff line change
1
+ server {
2
+ listen 80 ;
3
+ server_name localhost;
4
+ location / {
5
+ root /usr/share/nginx/html;
6
+ index index.html index.htm;
7
+ try_files $uri /index.html;
8
+ }
9
+ error_page 500 502 503 504 /50x.html;
10
+ location = /50x.html {
11
+ root /usr/share/nginx/html;
12
+ }
13
+ }
You can’t perform that action at this time.
0 commit comments