Skip to content

Commit f563fc7

Browse files
committed
Add Docker support for development
1 parent c32f76c commit f563fc7

File tree

4 files changed

+21
-2
lines changed

4 files changed

+21
-2
lines changed

Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM node
2+
WORKDIR /usr/src/app
3+
COPY ./package*.json ./
4+
RUN npm install
5+
CMD [ "npm", "start" ]

docker-compose.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: "3"
2+
services:
3+
web:
4+
build: .
5+
ports:
6+
- 8080:8080
7+
volumes:
8+
- .:/usr/src/app
9+
- /usr/src/app/node_modules

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"scripts": {
77
"test": "echo \"Error: no test specified\" && exit 1",
88
"build": "webpack",
9-
"start": "webpack-dev-server --open"
9+
"start": "webpack-dev-server"
1010
},
1111
"keywords": [],
1212
"author": "Colin Thornton",

webpack.config.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,12 @@ module.exports = {
4242
devtool: "source-map",
4343
devServer: {
4444
contentBase: "./dist",
45-
port: 8080
45+
host: "0.0.0.0",
46+
port: 8080,
47+
watchOptions: {
48+
aggregateTimeout: 300,
49+
poll: 1000
50+
}
4651
},
4752
plugins: [
4853
new CleanWebpackPlugin(),

0 commit comments

Comments
 (0)