0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-11-21 13:39:22 +01:00

Fix webpack-dev-server inside Docker (#2699)

This commit is contained in:
Michael Matloka 2020-12-08 11:44:39 +01:00 committed by GitHub
parent f3dc59d104
commit b39dce42cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 12 additions and 4 deletions

View File

@ -3,4 +3,4 @@
set -e
python manage.py migrate
python manage.py runserver 0.0.0.0:8000 & ./bin/start-worker & ./bin/start-frontend 0.0.0.0
python manage.py runserver 0.0.0.0:8000 & ./bin/start-worker & ./bin/docker-frontend

View File

@ -3,4 +3,4 @@
set -e
python manage.py migrate
python manage.py runserver 0.0.0.0:8000 & ./bin/start-frontend 0.0.0.0
python manage.py runserver 0.0.0.0:8000 & ./bin/docker-frontend

7
bin/docker-frontend Executable file
View File

@ -0,0 +1,7 @@
#!/bin/bash
set -e
export WEBPACK_HOT_RELOAD_HOST="0.0.0.0"
yarn install
yarn start-docker

View File

@ -4,4 +4,4 @@ set -e
python manage.py migrate
python manage.py migrate_clickhouse
python manage.py runserver 0.0.0.0:8000 & ./bin/start-frontend 0.0.0.0
python manage.py runserver 0.0.0.0:8000 & ./bin/docker-frontend

View File

@ -17,7 +17,7 @@ services:
build:
context: ../
dockerfile: dev.Dockerfile
command: ./bin/docker-ch-dev-web
command: ./ee/bin/docker-ch-dev-web
volumes:
- ..:/code
ports:

View File

@ -21,6 +21,7 @@
"start": "concurrently -n WEBPACK,TYPEGEN -c blue,green \"yarn run start-http\" \"yarn run typegen:watch\"",
"start-http": "mkdir -p frontend/dist/ && cp -a frontend/public/* frontend/dist/ && npm run copy-scripts && webpack-dev-server --hotOnly",
"start-https": "mkdir -p frontend/dist/ && cp -a frontend/public/* frontend/dist/ && npm run copy-scripts && webpack-dev-server --hotOnly --https",
"start-docker": "mkdir -p frontend/dist/ && cp -a frontend/public/* frontend/dist/ && npm run copy-scripts && webpack-dev-server --hotOnly --host 0.0.0.0",
"build": "echo \"Building Webpack\" && NODE_ENV=production webpack --config webpack.config.js && cp -a frontend/public/* frontend/dist/ && npm run copy-scripts",
"prettier": "prettier --write \"./frontend/src/**/*.{js,ts,tsx,json,yml,css,scss}\"",
"prettier:check": "prettier --check \"./**/*.{js,ts,tsx,json,yml,css,scss}\"",