Skip to content

Commit

Permalink
dockerize starterpack
Browse files Browse the repository at this point in the history
  • Loading branch information
BolajiOlajide committed Aug 27, 2018
1 parent fa9bf98 commit e388f6c
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 2 deletions.
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
2 changes: 1 addition & 1 deletion src/app/views/Content.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const Content = () => (
<a
href="https://www.w3schools.com/w3css/tryw3css_templates_coming_soon.htm"
target="_blank"
>W3C template</a>
>W3C template </a>
</p>
<p>
<span>Built with ❤️ by </span>
Expand Down
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'));
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

0 comments on commit e388f6c

Please sign in to comment.