Skip to content

Commit

Permalink
Improved the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
programarivm committed Jan 25, 2024
1 parent bdd2c56 commit d48ab11
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down Expand Up @@ -54,29 +56,29 @@ 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
```

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
```

Expand All @@ -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
```

0 comments on commit d48ab11

Please sign in to comment.