From d48ab110e59d8cb33d8029c08a6facc7d05bea1f Mon Sep 17 00:00:00 2001 From: programarivm Date: Thu, 25 Jan 2024 17:54:14 +0100 Subject: [PATCH] Improved the docs --- docs/installation.md | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/docs/installation.md b/docs/installation.md index c40bc3b0..e4951c03 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -10,23 +10,25 @@ You may want to optionally install Stockfish >= 15.1 as it is described in [Play Clone the `chesslablab/chess-server` repo into your projects folder as it is described in the following example: -``` +```txt git clone git@github.com:chesslablab/chess-server.git ``` Then `cd` the `chess-server` directory and install the Composer dependencies: -``` + +```txt composer install ``` Create an `.env` file: -``` + +```txt cp .env.example .env ``` Finally, you may want to add the following entry to your `/etc/hosts` file if running the PHP chess server on your localhost along with [React Chess](https://github.com/chesslablab/react-chess) as per the `REACT_APP_WS_HOST` variable defined in the [react-chess/.env.example](https://github.com/chesslablab/react-chess/blob/master/.env.example) file. -``` +```txt 127.0.0.1 async.chesslablab.org ``` @@ -54,17 +56,17 @@ php cli/testing.php Run the simple WebSocket server if you are not using an SSL/TLS certificate. -``` +```txt php cli/dev.php ``` ### Staging -> Before starting the secure WebSocket server for the first time, make sure to have created the `fullchain.pem` and `privkey.pem` files into the `ssl` folder. +Before starting the secure WebSocket server for the first time, make sure to have created the `fullchain.pem` and `privkey.pem` files into the `ssl` folder. Run the staging secure WebSocket server if you don't want to check the website's origin. -``` +```txt php cli/staging.php ``` @@ -72,11 +74,11 @@ This will allow any origin to send a request to it. ### Production -> Before starting the secure WebSocket server for the first time, make sure to have created the `fullchain.pem` and `privkey.pem` files into the `ssl` folder. +Before starting the secure WebSocket server for the first time, make sure to have created the `fullchain.pem` and `privkey.pem` files into the `ssl` folder. Run the secure WebSocket server to check the website's origin as defined in the `WSS_ALLOWED` variable in the `.env.example` file. -``` +```txt php cli/prod.php ``` @@ -88,24 +90,24 @@ Alternatively, the chess server can run on a Docker container. ### Functional Testing -``` +```txt docker compose -f docker-compose.testing.yml up -d ``` ### Development -``` +```txt docker compose -f docker-compose.dev.yml up -d ``` ### Staging -``` +```txt docker compose -f docker-compose.staging.yml up -d ``` ### Production -``` +```txt docker compose -f docker-compose.prod.yml up -d ```