Skip to content

Commit 6a72a56

Browse files
committed
Added dockerfile and Nginx.conf files
1 parent 5388398 commit 6a72a56

File tree

7 files changed

+103
-22081
lines changed

7 files changed

+103
-22081
lines changed

.dockerignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/node_modules
2+
3+
/build
4+
5+
.git
6+
7+
*.md
8+
9+
.gitignore

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
.env.development.local
1818
.env.test.local
1919
.env.production.local
20-
20+
.env
2121
npm-debug.log*
2222
yarn-debug.log*
2323
yarn-error.log*

.nginx/nginx.conf

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
worker_processes 4;
2+
3+
events { worker_connections 1024; }
4+
5+
http {
6+
server {
7+
listen 80;
8+
root /usr/share/nginx/html;
9+
include /etc/nginx/mime.types;
10+
11+
location /appui {
12+
try_files $uri /index.html;
13+
}
14+
}
15+
}

Dockerfile

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# stage1 as builder
2+
FROM node:10-alpine as builder
3+
4+
# copy the package.json to install dependencies
5+
COPY package.json package-lock.json ./
6+
7+
# Install the dependencies and make the folder
8+
RUN npm install && mkdir /react-ui && mv ./node_modules ./react-ui
9+
10+
WORKDIR /react-ui
11+
12+
COPY . .
13+
14+
# Build the project and copy the files
15+
RUN npm run build
16+
17+
18+
FROM nginx:alpine
19+
20+
#!/bin/sh
21+
22+
COPY ./.nginx/nginx.conf /etc/nginx/nginx.conf
23+
24+
## Remove default nginx index page
25+
RUN rm -rf /usr/share/nginx/html/*
26+
27+
# Copy from the stahg 1
28+
COPY --from=builder /react-ui/build /usr/share/nginx/html
29+
30+
EXPOSE 3000 80

0 commit comments

Comments
 (0)