Readme update

This commit is contained in:
Marwolf
2018-07-12 10:01:26 -04:00
parent e5a51c328a
commit 820b096bd7

156
README.md
View File

@@ -1,77 +1,71 @@
## Overview
1. [Install prerequisites](#install-prerequisites)
2. [Clone the project](#clone-the-project)
3. [Run the application](#run-the-application)
# Open-RSC Docker Home
An easy to run RSC private server environment
___
## Install prerequisites
This project has been created for `(Windows, Linux, and OS X)`.
This project has been made to work in `(Windows, Ubuntu Linux, and macOS)`.
Requisites:
Prerequisites:
* [Git](https://git-scm.com/downloads)
* [Docker](https://docs.docker.com/engine/installation/)
* [A DockerHub Account](https://hub.docker.com/)
[Guide for installing Docker on Ubuntu 18.04](https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-18-04)
If your running Ubuntu 18.04, execute this script and skip the rest of this section:
```sh
./install-docker-linux.sh
```
To manually set up the prerequisites in Ubuntu 18.04 (bionic) Linux (modify as needed):
```sh
sudo apt update && install build-essential apt-transport-https ca-certificates curl software-properties-common -y
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
sudo apt update && install docker-ce docker-compose -y
```
___
This project uses the following ports:
## Choice 1 (easy): Download the project zip, extract it, and open the "Single-Player" folder
| Server | Port |
|------------------------|-------|
| MySQL database server | 3306 |
| PHPMyAdmin | 8080 |
| Nginx web server | 80 |
https://github.com/Open-RSC/Docker-Home/archive/master.zip
___
## Clone the project
## Choice 2 (advanced): Clone the project with git
Install [Git](http://git-scm.com/book/en/v2/Getting-Started-Installing-Git), then clone the project:
```sh
git clone https://github.com/Marwolf/Open-RSC-Docker.git
git clone https://github.com/Open-RSC/Docker-Home.git
```
Go to the project directory:
```sh
cd Open-RSC-Docker
cd Docker-Home
```
___
## Important!
## Important for Windows users!
If you are using Windows, open Docker and make your drives available to your Docker containers:
Open Docker and make your drives available to your Docker containers:
![Shared drives setting](https://i.imgur.com/6YsGkoZ.png)
If you are using Linux (suggested to be Ubuntu 18.04 or above), install the build essentials AND docker-compose so that the make command works:
```sh
sudo apt install build-essential docker-compose
```
___
## Run the application
## Run the scripts
1. Perform first time setup and start the Docker application:
```sh
OS X/Linux: ./first-time-setup.sh
macOS/Ubuntu: ./first-time-setup-linux.sh
```
```sh
Windows: "First time setup.cmd"
Windows: "First Time Setup.cmd"
```
**Please wait this might take a several minutes...**
@@ -81,119 +75,55 @@ ___
* [http://localhost](http://localhost/)
* [http://localhost:8080](http://localhost:8080/) PHPMyAdmin (username: root, password: root)
3. Backup your databases:
3. Start the game's Docker containers, then run the game server and client:
```sh
OS X/Linux: ./backup-database.sh
macOS/Ubuntu: ./start-game-linux.sh
```
```sh
Windows: "Backup Databases.cmd"
Windows: "Start Game.cmd"
```
4. Restore your databases:
4. Backup game databases:
```sh
OS X/Linux: ./restore-database.sh
macOS/Ubuntu: ./backup-game-databases-linux.sh
```
```sh
Windows: "Restore Databases.cmd"
Windows: "Backup Game Databases.cmd"
```
5. Stop the application:
5. Restore game databases:
```sh
OS X/Linux: ./stop.sh
macOS/Ubuntu: ./restore-game-databases-linux.sh
```
```sh
Windows: "Stop Containers.cmd"
Windows: "Restore Game Databases.cmd"
```
6. Start the application:
6. Stop the game's Docker containers and shut down the game server:
```sh
OS X/Linux: ./start.sh
macOS/Ubuntu: ./stop-game-linux.sh
```
```sh
Windows: "Start Containers.cmd"
Windows: "Stop Game.cmd"
```
7. Restart the application:
7. View the game's Docker container logs:
```sh
./restart.sh
./view-docker-container-logs-linux.sh
```
```sh
Windows: "Restart Containers.cmd"
Windows: "View Docker Container Logs.cmd"
```
8. View container logs:
```sh
./view-logs.sh
```
```sh
Windows: "View Container Logs.cmd"
```
9. Pull repository updates:
```sh
./pull-updates.sh
```
```sh
Windows: "Pull Repository Updates.cmd"
```
___
## Additional commands for troubleshooting use
| Name | Description |
|---------------|-----------------------------------------------|
| first | Perform first time setup |
| clone | Clone the git repository folders |
| pull | Get the latest git repository updates |
| start | Create and start containers |
| stop | Stop all containers |
| restart | Restart all containers |
| logs | Display log output |
| import | Import all databases from git repositories |
| backup | Create backup of all local databases |
| restore | Restore backup of all local databases |
| flush | Delete local git repository folders |
___
## Optional: configure Nginx With SSL Certificates
You can change the host name by editing the `.env` file.
If you modify the host name, do not forget to add it to the `/etc/hosts` file.
1. Configure Nginx:
Do not modify the `Website/etc/nginx/default.conf` file, it is overwritten by `Website/etc/nginx/default.template.conf`
Edit nginx file `Website/etc/nginx/default.template.conf` and uncomment the SSL server section :
```sh
# server {
# server_name ${NGINX_HOST};
#
# listen 443 ssl;
# fastcgi_param HTTPS on;
# ...
# }
```
2. Copy your server.pem and server.key files in to the `Website/etc/nginx/ssl` folder and restart the application. ([Lets Encrypt](https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-18-04) can register SSL certs for free)
```sh
sudo make restart
```