diff --git a/README.md b/README.md index 4c200c5e6..e3951ba65 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ subproject, e.g. running or testing. - [Branching](#branching) - [Building ToC](#building-toc) - [Building Core UI for Production](#building-core-ui-for-production) + - [Building with a Container](#building-with-a-container) - [Committing](#committing) - [License Checking](#license-checking) @@ -111,7 +112,18 @@ To quickly produce a production build of Core UI, run from this folder: ```bash yarn install -yarn build:production:core +yarn build:production:ui:core +``` + +Assets are saved to `ui/core/dist/`. + +#### Building with a Container + +Optionally, you may build the UI within a container. Execute the +following command: + +```bash +./build_production.sh ``` Assets are saved to `ui/core/dist/`. diff --git a/docker-compose-embedding.yml b/docker-compose-embedding.yml new file mode 100644 index 000000000..1cd3d329b --- /dev/null +++ b/docker-compose-embedding.yml @@ -0,0 +1,29 @@ +# Note: this will change the permissions of the files in this directory after +# running to allow for easy deletion, so this should only be run as part of +# watchtower's build task. + +version: '3.8' + +services: + node: &node + image: node:12 + volumes: + - './:/src' + - 'icu_node_modules:/src/node_modules' + - 'icu_addons_api_node_modules:/src/addons/api/node_modules' + - 'icu_addons_auth_node_modules:/src/addons/auth/node_modules' + - 'icu_addons_rose_node_modules:/src/addons/rose/node_modules' + - 'icu_ui_core_node_modules:/src/ui/core/node_modules' + working_dir: /src + + build_production: + <<: *node + entrypoint: bash + command: '-c "yarn install && yarn build:production:ui:core && chmod -R 777 ."' + +volumes: + icu_node_modules: + icu_addons_api_node_modules: + icu_addons_auth_node_modules: + icu_addons_rose_node_modules: + icu_ui_core_node_modules: diff --git a/package.json b/package.json index 17d23d120..8e18bfe44 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "ui/*" ], "scripts": { - "build:production:core": "cd ui/core && yarn build:production", + "build:production:ui:core": "cd ui/core && yarn build:production", "lint": "yarn lint:addons:api && yarn lint:addons:auth && yarn lint:addons:rose && yarn lint:ui:core", "lint:addons:api": "echo \"\n\nlint: addons/api\n\" && cd addons/api && yarn lint", "lint:addons:auth": "echo \"\n\nlint: addons/auth\n\" && cd addons/auth && yarn lint",