mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-30 10:58:23 -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/*
|
locales/*
|
||||||
**/*.min.js
|
**/*.min.js
|
||||||
**/node_modules/*
|
**/node_modules/*
|
||||||
|
scratch-gui/*
|
||||||
|
|
|
@ -21,7 +21,18 @@ routes.forEach(route => {
|
||||||
app.get(route.pattern, handler(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 || '';
|
var proxyHost = process.env.FALLBACK || '';
|
||||||
if (proxyHost !== '') {
|
if (proxyHost !== '') {
|
||||||
|
|
|
@ -15,6 +15,7 @@ services:
|
||||||
environment:
|
environment:
|
||||||
- API_HOST=http://localhost:8491
|
- API_HOST=http://localhost:8491
|
||||||
- FALLBACK=http://localhost:8080
|
- FALLBACK=http://localhost:8080
|
||||||
|
- USE_DOCKER_WATCHOPTIONS=true
|
||||||
build:
|
build:
|
||||||
context: ./
|
context: ./
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
|
|
Loading…
Reference in a new issue