From b158dab01d53a60982081831451ef672a7c4ca15 Mon Sep 17 00:00:00 2001 From: "quanghnguyen@linagora.com" Date: Tue, 24 Sep 2024 15:57:30 +0700 Subject: [PATCH] TW-2036: Add readme to guide build docker image --- README.md | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/README.md b/README.md index 68c9ac7f0e..e5fc3a97a0 100644 --- a/README.md +++ b/README.md @@ -92,3 +92,55 @@ bash scripts/config-pre-commit.sh * WoodenBeaver sound theme for the notification sound. * The Matrix Foundation for making and maintaining the [emoji translations](https://github.com/matrix-org/matrix-doc/blob/main/data-definitions/sas-emoji.json) used for emoji verification, licensed Apache 2.0 + +### Setup to build web version using Docker + +- Go to the [docker hub](https://hub.docker.com/r/linagora/twake-web/tags) +- Pull the image using `docker pull linagora/twake-web:` +- Create a config file `config.json` in the root of the project with the following + [docs](https://github.com/linagora/twake-on-matrix/blob/main/docs/configurations/config_web_app_for_public_platform.md) +- Two options to build the web version: + - Run the image using docker desktop + - Open docker desktop + - Open [Image](linagora/twake-web/) and select the image you pulled + - Click on Run and open `Options Settings` + - Config the container name + - Config the host port + - Config the volume with host path and container path + - Host path should be the root of the the config.json file (.../config.json) + - Container path should be the root of the project: /usr/share/nginx/html/web/config.json + - Click on Run + - Open the browser and go to `http://localhost:` + - Run the image using docker CLI + - Open terminal and pull the image using the following command: + - `docker pull linagora/twake-web:` + - Run the image using the following command: + - `docker run -d -p :80 --name -v :/usr/share/nginx/html/web/config.json linagora/twake-web:` + - Open the browser and go to `http://localhost:` + +### Sample for build docker image using Docker CLI + +- Create a config file `config.json` with `matrix.org` + +``` +{ + "app_grid_dashboard_available": true, + "application_name": "Twake Chat", + "application_welcome_message": "Welcome to Twake Chat!", + "default_homeserver": "matrix.org", + "hide_redacted_events": false, + "hide_unknown_events": false, + "homeserver": "https://matrix.org/", + "issue_id": "", + "privacy_url": "https://twake.app/en/privacy/", + "render_html": true +} +``` + +- Open terminal and login to docker + - `docker login` +- Pull the image with tag `v2.6.5` using the following command: + - `docker pull linagora/twake-web:v2.6.5` +- Run the image using the following command: + - `docker run -d -p 8080:80 --name twake-web -v /path/to/config.json:/usr/share/nginx/html/web/config.json linagora/twake-web:v2.6.5` +- Open the browser and go to `http://localhost:8080` \ No newline at end of file