-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bdd2c56
commit d48ab11
Showing
1 changed file
with
15 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 [email protected]: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,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 | ||
``` | ||
|
||
|
@@ -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 | ||
``` |