Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerize starter #9

Merged
merged 5 commits into from
Aug 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules/
LICENSE
.vscode/
.idea/
yarn.lock
package-lock.json
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM node:carbon

LABEL maintainer="KINGDOM ISAAC"
LABEL version="1.0"

ENV HOME=/app
WORKDIR $HOME

COPY package.json .
RUN npm install
COPY . .

EXPOSE 8080

CMD [ "./start.sh" ]
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,17 @@ npm run report-coverage
* 0.0.1
* Work in progress

### Docker

Build the image with the command
```sh
docker build . -t react-webpack-start
```
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
```sh
docker run -p 8080:8080 -v rws:/app react-webpack-start:latest
```

## Meta

Orjiewuru Kingdom – [@kingisaac95](https://twitter.com/kingisaac95) – kingdom.orjiewuru@gmail.com
Expand Down
6 changes: 3 additions & 3 deletions src/app/App.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React from 'react';
import React, { Fragment } from 'react';
import Header from './components/Header';
import Content from './views/Content';

const App = () => (
<div>
<Fragment>
<Header />
<Content />
</div>
</Fragment>
);

export default App;
2 changes: 1 addition & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
<body>
<section id="root"></section>
</body>
</html>
</html>
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ import ReactDOM from 'react-dom';
import App from './app/App';
import './index.scss';

export const Root = () => <App />
export const Root = () => <App />;

ReactDOM.render(<Root />, document.getElementById('root'));
8 changes: 4 additions & 4 deletions src/styles/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ body {

hr {
border: 0;
border-top: 1px solid $white;
box-sizing: content-box;
height: 0;
overflow: visible;
border-top: 1px solid $white;
box-sizing: content-box;
height: 0;
overflow: visible;
}

.bgimg {
Expand Down
5 changes: 5 additions & 0 deletions start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

./node_modules/.bin/webpack-dev-server --mode development --host 0.0.0.0 # replacing this instead of npm start because of some flags

# if you intend to use docker for production, you can add a ternary here to toggle scripts
Loading