From f72b411106e5fe15c2e05bce54e01bdfc80d5cc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20T=C3=B3th?= Date: Sun, 1 Apr 2018 21:43:53 +0200 Subject: [PATCH] Write documentation on building & running --- README.md | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 09a9f75..1d52a01 100644 --- a/README.md +++ b/README.md @@ -30,4 +30,29 @@ This will set up a special version of `test-tutorial-framework` just for you: - the latest frontend is included in `solvable/frontend` with dependencies installed - `solvable/Dockerfile` is pinned to use the latest TFW baseimage -After this, you can run use the `hack/tfw.sh` script to build and run your copy (just call it without any arguments to see usage information). +## Building & running + +### Automated + +Our magical bash script `hack/tfw.sh` can handle everything for you. Just run it without any arguments to see usage information. + +It is advisable to run the frontend locally while developing to avoid really looooong build times. The `hack/tfw.sh` script handles this for you automagically. + +### Doing it manually + +In case you **must** do it for some reason you can build & run manually. +Note that this is relatively painful and you should use the `hack/tfw.sh` script when possible. + +Building without frontend – execute from project root: + +`docker build -t test-tutorial-framework -f solvable/Dockerfile --build-arg BUILD_CONTEXT=solvable --build-arg NOFRONTEND=1 .` + +This will create a Docker image without the frontend, which you can run locally. For procudtion builds exclude the argument `--build-arg NOFRONTEND=1` to include a frontend instance. + +Running – execute: + +`docker run --rm -p 8888:8888 -e AVATAO_SECRET=secret test-tutorial-framework` + +In case of a frontendless build (with `--build-arg NOFRONTEND=1`) you will need to run `yarn start` from the `solvable/frontend` directory as well. This will serve the frontend on `http://localhost:4200`. + +If you've created a production build (without `--build-arg NOFRONTEND=1`) you don't have to run the frontend locally and you can access the challenge on `http://localhost:8888`.