* initial attempt at a docker based MEW for dev

* add webpack dev polling which is needed when mounting on windows. https://github.com/webpack/webpack-dev-server/issues/155#issuecomment-159140735

* readme
This commit is contained in:
Daniel Ternyak 2017-07-10 22:03:08 -05:00 committed by GitHub
parent 8092a5dec3
commit 52cbdfbd0f
4 changed files with 29 additions and 0 deletions

8
Dockerfile Normal file
View File

@ -0,0 +1,8 @@
FROM node:7.7.2
WORKDIR /usr/app
COPY package.json .
RUN npm install --quiet
COPY . .

View File

@ -39,3 +39,10 @@ npm run test # run tests with Jest
├── webpack_config - Webpack configuration
├── jest_config - Jest configuration
```
## Docker setup
You should already have docker and docker-compose setup for your platform as a pre-req.
```bash
docker-compose up
```

10
docker-compose.yml Normal file
View File

@ -0,0 +1,10 @@
version: '2'
services:
web:
build: .
command: npm run dev
volumes:
- .:/usr/app/
- /usr/app/node_modules
ports:
- "3000:3000"

View File

@ -35,6 +35,10 @@ const devMiddleWare = require('webpack-dev-middleware')(compiler, {
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': '*',
'Access-Control-Allow-Headers': '*'
},
watchOptions: {
aggregateTimeout: 300,
poll: true
}
});
app.use(devMiddleWare);