Skip to content

Commit ac86601

Browse files
author
Manoj Selvin
committed
Initial Push
1 parent ec617a0 commit ac86601

File tree

4 files changed

+45
-2
lines changed

4 files changed

+45
-2
lines changed

Dockerfile

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM node:alpine3.10 as builder
2+
3+
WORKDIR /var/www/html/react-app
4+
COPY package.json .
5+
RUN npm install
6+
COPY . .
7+
8+
RUN npm run build
9+
10+
FROM nginx
11+
COPY --from=builder /var/www/html/react-app/build /usr/share/nginx/html
12+

Dockerfile.dev

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM node:alpine3.10
2+
3+
WORKDIR /var/www/html/react-app
4+
5+
COPY package.json .
6+
RUN npm install
7+
COPY . .
8+
9+
CMD [ "npm", "run", "start" ]

docker-compose.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
version: '3'
2+
3+
services:
4+
web:
5+
build:
6+
context: .
7+
dockerfile: Dockerfile.dev
8+
stdin_open: true
9+
ports:
10+
- '3000:3000'
11+
volumes:
12+
- /var/www/html/react-app/node_modules
13+
- .:/var/www/html/react-app
14+
tests:
15+
build:
16+
context: .
17+
dockerfile: Dockerfile.dev
18+
stdin_open: true
19+
volumes:
20+
- /var/www/html/react-app/node_modules
21+
- .:/var/www/html/react-app
22+
command: ["npm", "run", "test"]

src/App.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ function App() {
88
<header className="App-header">
99
<img src={logo} className="App-logo" alt="logo" />
1010
<p>
11-
Edit <code>src/App.js</code> and save to reload.
11+
Hello Moto
1212
</p>
1313
<a
1414
className="App-link"
1515
href="https://reactjs.org"
1616
target="_blank"
1717
rel="noopener noreferrer"
1818
>
19-
Learn React
19+
Learn ReactJS
2020
</a>
2121
</header>
2222
</div>

0 commit comments

Comments
 (0)