Skip to content

Commit d457257

Browse files
author
Orjiewuru Kingdom Isaac
authored
Merge pull request #10 from kingisaac95/feature/develop
Feature: Add Docker
2 parents f4eefcb + f0b323f commit d457257

File tree

11 files changed

+96
-11
lines changed

11 files changed

+96
-11
lines changed

.dockerignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules/
2+
LICENSE
3+
.vscode/
4+
.idea/
5+
yarn.lock
6+
package-lock.json

Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM node:carbon
2+
3+
LABEL maintainer="Orjiewuru Kingdom (kingisaac95)"
4+
LABEL version="0.1.1"
5+
6+
ENV HOME=/app
7+
WORKDIR $HOME
8+
9+
COPY package.json .
10+
RUN npm install
11+
COPY . .
12+
13+
EXPOSE 8080
14+
15+
CMD [ "./start.sh" ]

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
build:
2+
webpack --mode production
3+
4+
build-docker:
5+
docker build . -t react-webpack-starter
6+
7+
run-docker:
8+
docker run -t -i -p 8080:8080 -v rws:/app react-webpack-starter:latest

README.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,45 @@ Run Coverage
4545
npm run report-coverage
4646
```
4747

48+
## Docker
49+
50+
Build the image with the command
51+
52+
```sh
53+
docker build . -t react-webpack-starter
54+
```
55+
56+
This builds the image with the tag `react-webpack-starter`. Once this is completed, you can instantiate the container with the image with the command
57+
58+
```sh
59+
docker run -t -i -p 8080:8080 -v rws:/app react-webpack-starter:latest
60+
```
61+
62+
## Using Makefile
63+
64+
Build Docker Image
65+
66+
```sh
67+
make build-docker
68+
```
69+
70+
Run Docker Image
71+
72+
```sh
73+
make run-docker
74+
```
75+
76+
Generate Production Build
77+
78+
```sh
79+
make build
80+
```
81+
4882
## Release History
4983

5084
* 0.1.1
85+
* Dockerize application
86+
* Add Makefile
5187
* Update Readme and add badges
5288
* Setup Travis build and add tests
5389
* 0.1.0
@@ -70,7 +106,7 @@ Distributed under the MIT license. See ``LICENSE`` for more information.
70106
2. Create your feature branch (`git checkout -b feature/fooBar`)
71107
3. Commit your changes (`git commit -am 'Add some fooBar'`)
72108
4. Push to the branch (`git push origin feature/fooBar`)
73-
5. Create a new Pull Request
109+
5. Create a new Pull Request to branch `feature/develop`
74110

75111
## Security Vulnerabilities
76112

docs/pull_request_template.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#### What does this PR do
2+
3+
* Add purpose of PR
4+
5+
#### Description of Task to be completed
6+
7+
* Add description
8+
9+
#### How should this be manually tested
10+
11+
* Add testing instructions
12+
13+
#### Reviewers
14+
15+
* @kingisaac95

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"report-coverage": "jest --env=jsdom --coverage --coverageReporters=text-lcov | coveralls"
1111
},
1212
"keywords": [],
13-
"author": "kingisaac95",
13+
"author": "Orjiewuru Kingdom (kingisaac95)",
1414
"license": "MIT",
1515
"devDependencies": {
1616
"babel-core": "^6.26.3",

src/app/App.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import React from 'react';
1+
import React, { Fragment } from 'react';
22
import Header from './components/Header';
33
import Content from './views/Content';
44

55
const App = () => (
6-
<div>
6+
<Fragment>
77
<Header />
88
<Content />
9-
</div>
9+
</Fragment>
1010
);
1111

1212
export default App;

src/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010
<body>
1111
<section id="root"></section>
1212
</body>
13-
</html>
13+
</html>

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ import ReactDOM from 'react-dom';
44
import App from './app/App';
55
import './index.scss';
66

7-
export const Root = () => <App />
7+
export const Root = () => <App />;
88

99
ReactDOM.render(<Root />, document.getElementById('root'));

src/styles/main.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ body {
1313

1414
hr {
1515
border: 0;
16-
border-top: 1px solid $white;
17-
box-sizing: content-box;
18-
height: 0;
19-
overflow: visible;
16+
border-top: 1px solid $white;
17+
box-sizing: content-box;
18+
height: 0;
19+
overflow: visible;
2020
}
2121

2222
.bgimg {

0 commit comments

Comments
 (0)