diff --git a/docs/build.md b/docs/build.md index 2afeb489b..6db7c0a5e 100644 --- a/docs/build.md +++ b/docs/build.md @@ -2,6 +2,13 @@ The Content App is based on [Angular CLI](https://cli.angular.io), and you can use all the commands, generators and blueprints supported by the CLI. +## Prerequisites + +- [Node.js](https://nodejs.org/en/) 8.9.1 or later LTS version +- [Angular CLI](https://cli.angular.io/) + +## Cloning and running + Use the following commands to clone a copy of the project, install dependencies and run it. ```sh diff --git a/docs/docker.md b/docs/docker.md index 8f24330cc..3d98a5f05 100644 --- a/docs/docker.md +++ b/docs/docker.md @@ -86,3 +86,51 @@ To perform a cleanup operation, use the next command: ```sh docker-compose down --rmi all ``` + +## Publishing to Docker Hub + +First of all, if you do not have a Docker Hub account, you can register here: https://hub.docker.com/, the registration is absolutely free. + +Next, it is recommended that you get a clean build of the application: + +```sh +npm install +npm run build:dev +``` + +The commands above are going to produce a fresh build that is stored in the `dist` folder. +At this point, you can make modifications to the final code in the `dist` folder if needed. +For example you may want to change the `app.config.json` file content. + +Now you can build your first version of the image: + +```sh +docker image build -t myaccount/content-app:1.0 . +``` + +Where `myaccount` is usually your Docker Hub account name. + +

+Please note the ending "." symbol at the end of the command. It instructs the Docker to take current folder where the `Dockerfile` is located. +

+ +To publish the newly created image use the next command: + +```sh +docker push myaccount/content-app:1.0 +``` + +## Running from Docker Hub + +In order to quickly test the published image, or run it on another machine, use the following command: + +```sh +docker container run -p 80:80 --rm myaccount/content-app:1.0 +``` + +The `--rm` switch means the Docker will cleanup the container and image data once you stop the process. + +

+You may also want to remove your local image before trying out the Docker Hub:
+`docker image rm myaccount/content-app:1.0` +