File tree Expand file tree Collapse file tree 4 files changed +39
-4
lines changed Expand file tree Collapse file tree 4 files changed +39
-4
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- FROM nginx:1.15.10-alpine
2- COPY ./build /var/www
1+ # ### Stage 1: Build the react application
2+ FROM node:12.4.0-alpine as build
3+
4+ # Configure the main working directory inside the docker image.
5+ # This is the base directory used in any further RUN, COPY, and ENTRYPOINT
6+ # commands.
7+ WORKDIR /app
8+
9+ # Copy the package.json as well as the package-lock.json and install
10+ # the dependencies. This is a separate step so the dependencies
11+ # will be cached unless changes to one of those two files
12+ # are made.
13+ COPY package.json package-lock.json ./
14+ RUN npm install
15+
16+ # Copy the main application
17+ COPY . ./
18+
19+ # Build the application
20+ RUN npm run build
21+
22+ # ### Stage 2: Serve the React application from Nginx
23+ FROM nginx:1.17.0-alpine
24+
25+ # Copy the react build from Stage 1
26+ COPY --from=build /app/build /var/www
27+
28+ # Copy our custom nginx config
329COPY nginx.conf /etc/nginx/nginx.conf
30+
31+ # Expose port 3000 to the Docker host, so we can access it
32+ # from the outside.
433EXPOSE 80
34+
535ENTRYPOINT ["nginx" ,"-g" ,"daemon off;" ]
Original file line number Diff line number Diff line change @@ -24,11 +24,13 @@ http {
2424 server {
2525 # listen on port 80
2626 listen 80 ;
27+
2728 # save logs here
2829 access_log /var/log/nginx/access.log compression;
2930
30- # where the root here
31+ # nginx root directory
3132 root /var/www;
33+
3234 # what file to server as index
3335 index index .html index .htm;
3436
Original file line number Diff line number Diff line change 1414 <parent >
1515 <groupId >org.springframework.boot</groupId >
1616 <artifactId >spring-boot-starter-parent</artifactId >
17- <version >2.0.0 .RELEASE</version >
17+ <version >2.1.6 .RELEASE</version >
1818 <relativePath /> <!-- lookup parent from repository -->
1919 </parent >
2020
You can’t perform that action at this time.
0 commit comments