Skip to content

Commit d775309

Browse files
committed
Bump up spring boot version
1 parent e20fca8 commit d775309

File tree

4 files changed

+39
-4
lines changed

4 files changed

+39
-4
lines changed

polling-app-client/.dockerignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.git
2+
node_modules
3+
build

polling-app-client/Dockerfile

+32-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,35 @@
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
329
COPY nginx.conf /etc/nginx/nginx.conf
30+
31+
# Expose port 3000 to the Docker host, so we can access it
32+
# from the outside.
433
EXPOSE 80
34+
535
ENTRYPOINT ["nginx","-g","daemon off;"]

polling-app-client/nginx.conf

+3-1
Original file line numberDiff line numberDiff 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

polling-app-server/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
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

0 commit comments

Comments
 (0)