Skip to content

Commit 54914c7

Browse files
author
Orjiewuru Kingdom Isaac
authored
Merge pull request #9 from BolajiOlajide/dockerize-starter
Dockerize starter
2 parents 326ec83 + 249e61c commit 54914c7

File tree

9 files changed

+8196
-9
lines changed

9 files changed

+8196
-9
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="KINGDOM ISAAC"
4+
LABEL version="1.0"
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" ]

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,17 @@ npm run report-coverage
5656
* 0.0.1
5757
* Work in progress
5858

59+
### Docker
60+
61+
Build the image with the command
62+
```sh
63+
docker build . -t react-webpack-start
64+
```
65+
This builds the image with the tag `react-webpack-start`. Once this is completed, you can instantiate the container with the image with the command
66+
```sh
67+
docker run -p 8080:8080 -v rws:/app react-webpack-start:latest
68+
```
69+
5970
## Meta
6071

6172
Orjiewuru Kingdom – [@kingisaac95](https://twitter.com/kingisaac95)[email protected]

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 {

start.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
3+
./node_modules/.bin/webpack-dev-server --mode development --host 0.0.0.0 # replacing this instead of npm start because of some flags
4+
5+
# if you intend to use docker for production, you can add a ternary here to toggle scripts

0 commit comments

Comments
 (0)