Frontend for SmoglyAirMonitor project. Powered by React
npm run build- build files to be used for productionnpm run start- run a test server with hot reload on localhost:8080npm run test- run testsnpm run test:watch- run tests continuouslynpm run coverage- run coverage report
-
install docker and docker-compose
-
copy docker-compose.yml to root project dir to have Your own local copy
cp ./docker/docker-compose.yml ./docker-compose.yml
docker-compose up- start webpack-dev-server with hot reloading and log output, you need to wait a bit for package.json requirements to download- point your browser to
localhost:8081 - press
CTRL+Cto stop
- Each change in the code should be reflected automatically in Your browser.
- To run one off
package.jsonconfigured command just dodocker-compose run --rm web npm run YOUR_CMD. - To get into shell of container to debug
docker-compose run --rm web bash. - Executing container will automatically prune and install new dependencies from
packages.jsonrebuilding is not needed. - To change ENV variables check this docker-compose
manual + defaults set in
Dockerfile. - To add more concurrent execution of
packages.jsoncommands just add entry in Your copied docker-compose.yml like so:
builder:
extends:
file: docker-compose-base.yml
service: web
command: "npm run build:watch"
- We recommend setting up bash aliases to increase productivity:
#!/bin/bash
dcclear() {
docker images -qf dangling=true | xargs -r docker rmi
docker volume ls -qf dangling=true | xargs -r docker volume rm
}
alias dc='docker-compose'
alias dcrun='docker-compose run --rm'