From eadbbc4a10e2681d12856b68c273895e96c46f0f Mon Sep 17 00:00:00 2001 From: Anton Ovcharenko Date: Mon, 17 Oct 2022 15:19:34 +0300 Subject: [PATCH 1/4] add Docker Compose section to README.md --- README.md | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/README.md b/README.md index 9458497..c1a61aa 100644 --- a/README.md +++ b/README.md @@ -205,6 +205,72 @@ docker commit Then check if the image has been successfully created, using `docker images` command. You will see the list of existing images. Use this new image to create new containers following the instructions on how to run container above. +## Docker Compose + +Instead of using lengthy `docker run` commands, it is possible to keep all the configuration in a `docker-compose.yml` file (name is important, extension can be `yaml` or `yml`) and deploy it using `docker compose up` from the same directory. For more information, please refer to the [documentation](https://docs.docker.com/compose/). + + +Sample `docker-compose.yml` content: +```yaml +version: "3" +services: + wscservice: + image: webspellchecker/wproofreader:latest + container_name: wscservice + ports: + - "80:8080" + environment: + - PROTOCOL=2 + - WEB_PORT=80 + - DOMAIN_NAME=localhost + - VIRTUAL_DIR=wscservice +``` + +Notes: +1. If you have a licence key, pass it as an environment variable like that: + ``` - LICENSE_TICKET_ID=``` + The server will be activated automatically upon startup. +2. This deploys the WProofreader server working with HTTP protocol. To use it over HTTPS please change the following sections to: + ```yaml + ports: + - "443:8443" + environment: + - PROTOCOL=1 + - WEB_PORT=443 + - DOMAIN_NAME=localhost + - VIRTUAL_DIR=wscservice +``` +3. For HTTPS communication you have to provide your certificate file and key, as a pair of files named `cert.pem` and `key.pem`, respectively. If, for instance, they are kept in a folder `/home/user/certificate`, one should add the following section to `docker-compose.yml`: + ```yaml + volumes: + - /home/user/certificate:/certificate + ``` +4. If you have to use custom dictionaries, mount the folder they are located in in the docker container the same way: + ```yaml + volumes: + - /home/user/dictionaries:/dictionaries + ``` + +Finally, the whole config with activation, custom dictionaries and HTTPS would look like this: +```yaml +version: "3" +services: + wscservice: + image: webspellchecker/wproofreader:latest + container_name: wscservice + ports: + - "443:8443" + environment: + - PROTOCOL=1 + - WEB_PORT=443 + - DOMAIN_NAME=localhost + - VIRTUAL_DIR=wscservice + - LICENSE_TICKET_ID=ABCD1234 + volumes: + - /home/user/certificate:/certificate + - /home/user/dictionaries:/dictionaries +``` + ## Further steps Once a docker container with the app is up and running, you can integrate JavaScript libs/components or plugin it into your web app. From b5ee42a3eb5d2d75ba74dc3b23d1741795c62d19 Mon Sep 17 00:00:00 2001 From: Anton Ovcharenko Date: Mon, 17 Oct 2022 21:02:06 +0300 Subject: [PATCH 2/4] change sample container name to wproofreader --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c1a61aa..b2eecf6 100644 --- a/README.md +++ b/README.md @@ -214,9 +214,9 @@ Sample `docker-compose.yml` content: ```yaml version: "3" services: - wscservice: + wproofreader: image: webspellchecker/wproofreader:latest - container_name: wscservice + container_name: wproofreader ports: - "80:8080" environment: @@ -255,9 +255,9 @@ Finally, the whole config with activation, custom dictionaries and HTTPS would l ```yaml version: "3" services: - wscservice: + wproofreader: image: webspellchecker/wproofreader:latest - container_name: wscservice + container_name: wproofreader ports: - "443:8443" environment: From b7bc3537d082e066c720cd4d8ac999a4a17c3907 Mon Sep 17 00:00:00 2001 From: Anton Ovcharenko Date: Fri, 4 Nov 2022 18:42:50 +0200 Subject: [PATCH 3/4] add `command` for readability --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b2eecf6..997fdfd 100644 --- a/README.md +++ b/README.md @@ -207,7 +207,7 @@ Then check if the image has been successfully created, using `docker images` com ## Docker Compose -Instead of using lengthy `docker run` commands, it is possible to keep all the configuration in a `docker-compose.yml` file (name is important, extension can be `yaml` or `yml`) and deploy it using `docker compose up` from the same directory. For more information, please refer to the [documentation](https://docs.docker.com/compose/). +Instead of using lengthy `docker run` commands, it is possible to keep all the configuration in a `docker-compose.yml` file (name is important, extension can be `yaml` or `yml`) and deploy it using `docker compose up` command from the same directory. For more information, please refer to the [documentation](https://docs.docker.com/compose/). Sample `docker-compose.yml` content: From cc8427a93571915e41108a284a1012f4c8a7ff3f Mon Sep 17 00:00:00 2001 From: Anton Ovcharenko Date: Wed, 23 Nov 2022 13:17:58 +0200 Subject: [PATCH 4/4] fix namings --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 997fdfd..153a798 100644 --- a/README.md +++ b/README.md @@ -216,7 +216,7 @@ version: "3" services: wproofreader: image: webspellchecker/wproofreader:latest - container_name: wproofreader + container_name: wproofreader-server ports: - "80:8080" environment: @@ -230,7 +230,7 @@ Notes: 1. If you have a licence key, pass it as an environment variable like that: ``` - LICENSE_TICKET_ID=``` The server will be activated automatically upon startup. -2. This deploys the WProofreader server working with HTTP protocol. To use it over HTTPS please change the following sections to: +2. This deploys the WProofreader Server working with HTTP protocol. To use it over HTTPS please change the following sections to: ```yaml ports: - "443:8443" @@ -245,7 +245,7 @@ Notes: volumes: - /home/user/certificate:/certificate ``` -4. If you have to use custom dictionaries, mount the folder they are located in in the docker container the same way: +4. If you have to use custom dictionaries, mount the folder they are located in the docker container the same way: ```yaml volumes: - /home/user/dictionaries:/dictionaries @@ -257,7 +257,7 @@ version: "3" services: wproofreader: image: webspellchecker/wproofreader:latest - container_name: wproofreader + container_name: wproofreader-server ports: - "443:8443" environment: