mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-27 09:35:56 -05:00
Merge pull request #1975 from colbygk/docker_ergonomics
watchOptions required for use in docker environment
This commit is contained in:
commit
21d2f73bd7
3 changed files with 14 additions and 1 deletions
|
@ -5,3 +5,4 @@ intl/*
|
|||
locales/*
|
||||
**/*.min.js
|
||||
**/node_modules/*
|
||||
scratch-gui/*
|
||||
|
|
|
@ -21,7 +21,18 @@ routes.forEach(route => {
|
|||
app.get(route.pattern, handler(route));
|
||||
});
|
||||
|
||||
app.use(webpackDevMiddleware(compiler));
|
||||
var middlewareOptions = {};
|
||||
if (process.env.USE_DOCKER_WATCHOPTIONS) {
|
||||
middlewareOptions = {
|
||||
watchOptions: {
|
||||
aggregateTimeout: 500,
|
||||
poll: 2500,
|
||||
ignored: ['node_modules', 'build']
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
app.use(webpackDevMiddleware(compiler, middlewareOptions));
|
||||
|
||||
var proxyHost = process.env.FALLBACK || '';
|
||||
if (proxyHost !== '') {
|
||||
|
|
|
@ -15,6 +15,7 @@ services:
|
|||
environment:
|
||||
- API_HOST=http://localhost:8491
|
||||
- FALLBACK=http://localhost:8080
|
||||
- USE_DOCKER_WATCHOPTIONS=true
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: Dockerfile
|
||||
|
|
Loading…
Reference in a new issue