Skip to content

Commit

Permalink
Add some finishing touches to Docker + Hot loader support
Browse files Browse the repository at this point in the history
There was a bug on Windows machines (not OSX) where changes to source
code weren't getting picked up by the hotloader, even though the hot
loader was running. The fix was to enable polling in the hot loader
server config
(webpack/webpack-dev-server#143 (comment))

I also fixed the links to the static files in the html template to point
to the /static/ nginx path

I also refactored the two docker files into a folder, so they aren't
just floating around at the project root
  • Loading branch information
luisnaranjo733 committed Mar 27, 2017
1 parent 1164d34 commit c01fc9f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ services:
web:
build:
context: .
dockerfile: web.Dockerfile
dockerfile: docker/web.Dockerfile
container_name: dg01
command: bash -c "python manage.py makemigrations && python manage.py migrate && gunicorn InForm.wsgi -b 0.0.0.0:8000"
volumes:
Expand All @@ -25,7 +25,7 @@ services:
hotloader:
build:
context: .
dockerfile: hotloader.Dockerfile
dockerfile: docker/hotloader.Dockerfile
container_name: hl01
command: bash -c "npm install && npm start"
volumes:
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/forms/templates/forms/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://code.getmdl.io/1.2.1/material.indigo-pink.min.css">
<script defer src="https://code.getmdl.io/1.2.1/material.min.js"></script>
<link rel="stylesheet" href="../../../assets/css/main.css">
<link rel="stylesheet" href="/static/css/main.css">
<!--<script defer src="bundles/bundle.js"></script>-->
</head>

Expand Down
3 changes: 3 additions & 0 deletions src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ var config = require('./webpack.config')

new WebpackDevServer(webpack(config), {
publicPath: config.output.publicPath,
watchOptions: {
poll: true
},
hot: true,
inline: true,
historyApiFallback: true
Expand Down

0 comments on commit c01fc9f

Please sign in to comment.