Docker (#40)
* 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:
parent
8092a5dec3
commit
52cbdfbd0f
|
@ -0,0 +1,8 @@
|
||||||
|
FROM node:7.7.2
|
||||||
|
|
||||||
|
WORKDIR /usr/app
|
||||||
|
|
||||||
|
COPY package.json .
|
||||||
|
RUN npm install --quiet
|
||||||
|
|
||||||
|
COPY . .
|
|
@ -39,3 +39,10 @@ npm run test # run tests with Jest
|
||||||
├── webpack_config - Webpack configuration
|
├── webpack_config - Webpack configuration
|
||||||
├── jest_config - Jest 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
|
||||||
|
```
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
version: '2'
|
||||||
|
services:
|
||||||
|
web:
|
||||||
|
build: .
|
||||||
|
command: npm run dev
|
||||||
|
volumes:
|
||||||
|
- .:/usr/app/
|
||||||
|
- /usr/app/node_modules
|
||||||
|
ports:
|
||||||
|
- "3000:3000"
|
|
@ -35,6 +35,10 @@ const devMiddleWare = require('webpack-dev-middleware')(compiler, {
|
||||||
'Access-Control-Allow-Origin': '*',
|
'Access-Control-Allow-Origin': '*',
|
||||||
'Access-Control-Allow-Methods': '*',
|
'Access-Control-Allow-Methods': '*',
|
||||||
'Access-Control-Allow-Headers': '*'
|
'Access-Control-Allow-Headers': '*'
|
||||||
|
},
|
||||||
|
watchOptions: {
|
||||||
|
aggregateTimeout: 300,
|
||||||
|
poll: true
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
app.use(devMiddleWare);
|
app.use(devMiddleWare);
|
||||||
|
|
Loading…
Reference in New Issue