Compare commits
21 Commits
9ffde6bccb
...
c9c854ed41
Author | SHA1 | Date | |
---|---|---|---|
c9c854ed41 | |||
0d57268700 | |||
f6fc1021d5 | |||
1ff04d3e1e | |||
fdd1fa50ff | |||
5f381ecd63 | |||
6d912268db | |||
4ab0cd7be2 | |||
6440dea859 | |||
35f7972cd4 | |||
7e12d32f9e | |||
984ae4dc27 | |||
33deefdd9e | |||
5eebaf8ec4 | |||
9d459e0ab7 | |||
47aaf3f3d6 | |||
17633c4005 | |||
1c4c9420f8 | |||
41ba159bb1 | |||
644706616a | |||
c7ab923563 |
118
README.md
118
README.md
@ -2,81 +2,81 @@
|
||||
|
||||
[![Build Status](https://ci.esoko.eu/job/rvr-nextgen/job/master/badge/icon)](https://ci.esoko.eu/job/rvr-nextgen/job/master/)
|
||||
|
||||
This is the RVR Application project.
|
||||
This is the RVR Application project. This is a game about guessing where you are based on a street view panorama - inspired by existing applications.
|
||||
|
||||
## Installation
|
||||
|
||||
### Set environment variables
|
||||
### Clone the Git repository
|
||||
|
||||
The `.env` file contains several environment variables that are needed by the application to work properly. These should be configured for your environment. Check `.env.example` for reference.
|
||||
|
||||
**Important: `DEV` should NOT be set for production! See section Development if you want to use the application in development mode.**
|
||||
|
||||
### Docker Compose
|
||||
|
||||
Create a `docker-compose.yml` file. The example code below assumes that `.env` is placed in the same folder.
|
||||
|
||||
```yml
|
||||
version: '3'
|
||||
services:
|
||||
app:
|
||||
image: git.esoko.eu/esoko/rvr:latest
|
||||
depends_on:
|
||||
mariadb:
|
||||
condition: service_healthy
|
||||
ports:
|
||||
- 80:80
|
||||
volumes:
|
||||
- .env:/var/www/rvr/.env
|
||||
mariadb:
|
||||
image: mariadb:10.3
|
||||
volumes:
|
||||
- mysql:/var/lib/mysql
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: 'root'
|
||||
MYSQL_DATABASE: 'rvr'
|
||||
MYSQL_USER: 'rvr'
|
||||
MYSQL_PASSWORD: 'rvr'
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "mysqladmin -u $$MYSQL_USER -p$$MYSQL_PASSWORD ping -h localhost || exit 1"]
|
||||
start_period: 5s
|
||||
start_interval: 1s
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
volumes:
|
||||
mysql:
|
||||
The first step is obviously cloning the repository to your machine:
|
||||
|
||||
```
|
||||
git clone https://git.esoko.eu/esoko/rvr-nextgen.git
|
||||
```
|
||||
|
||||
Execute the following command:
|
||||
```bash
|
||||
All the commands listed here should be executed from the repository root.
|
||||
|
||||
### Setup Docker stack (recommended)
|
||||
|
||||
The easiest way to build up a fully working application with web server and database is to use Docker Compose with the included `docker-compose.yml`.
|
||||
|
||||
All you have to do is executing the following command:
|
||||
|
||||
```
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
Attach shell to the container of `rvr-nextgen-app`:
|
||||
|
||||
**And you are done!** The application is ready to use. You can create the first administrative user with the following command after attaching to the `app` container:
|
||||
```
|
||||
docker exec -it rvr-nextgen-app bash
|
||||
```
|
||||
|
||||
All of the following commands should be executed there.
|
||||
|
||||
### Manual setup (alternative)
|
||||
|
||||
If you don't use the Docker stack you need to install your environment manually. Check `docker-compose.yml` and `docker/Dockerfile` to see the system requirements.
|
||||
|
||||
### Initialize project
|
||||
|
||||
This command installes all of the Composer requirements and creates a copy of the example `.env` file.
|
||||
|
||||
```
|
||||
composer create-project
|
||||
```
|
||||
|
||||
### Set environment variables
|
||||
|
||||
The `.env` file contains several environment variables that are needed by the application to work properly. These should be configured for your environment.
|
||||
|
||||
One very important variable is `DEV`. This indicates that the application operates in development (staging) and not in production mode.
|
||||
|
||||
**Hint:** If you install the application in the Docker stack for development (staging) environment, only the variables for external dependencies (API keys, map attribution, etc.) should be adapted. All other variables (for DB connection, static root, mailing, multiplayer, etc.) are fine with the default value.
|
||||
|
||||
### (Production only) Create cron job
|
||||
|
||||
To maintain database (delete inactive users, old sessions etc.), the command `db:maintain` should be regularly executed. It is recommended to create a cron job that runs every hour:
|
||||
|
||||
```
|
||||
0 * * * * /path/to/your/installation/rvr db:maintain >>/var/log/cron-rvr.log 2>&1
|
||||
```
|
||||
|
||||
### Finalize installation
|
||||
|
||||
After you followed the above steps, execute the following command:
|
||||
|
||||
```
|
||||
scripts/install.sh
|
||||
```
|
||||
|
||||
**And you are done!** The application is ready to use and develop. In development mode an administrative user is also created by the installation script, email is **rvr@rvr.dev**, password is **123456**. In production mode you should create the first administrative user with the following command:
|
||||
|
||||
```
|
||||
./rvr user:add EMAIL PASSWORD admin
|
||||
```
|
||||
|
||||
## Development
|
||||
|
||||
### Set environment variables
|
||||
|
||||
`.env.example` should be copied to `.env` into the repo root. Only the variables for external dependencies (API keys, map attribution, etc.) should be adapted. All other variables (for DB connection, static root, mailing, multiplayer, etc.) are fine with the default value. **`DEV=1` should be set for development!**
|
||||
|
||||
### Docker Compose
|
||||
|
||||
Execute the following command from the repo root:
|
||||
```bash
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
**And you are done!** You can reach the application on http://localhost. The mails that are sent by the application can be found on http://localhost:8080. If needed, the database server can be directly reached on localhost:3306, or you can use Adminer web interface on http://localhost:9090
|
||||
|
||||
You might have to attach to the `app` container, e.g. for creating users, `composer update`, etc.
|
||||
If you installed it in the Docker stack, you can reach it on http://localhost. The mails that are sent by the application can be found on http://localhost:8080/. If needed, the database server can be directly reached on localhost:3306.
|
||||
|
||||
---
|
||||
|
||||
|
@ -13,7 +13,7 @@ USER_UID=$(stat -c "%u" .env)
|
||||
USER_GID=$(stat -c "%g" .env)
|
||||
groupadd --gid $USER_GID rvr
|
||||
useradd --uid $USER_UID --gid $USER_GID rvr
|
||||
chown -R rvr:rvr cache
|
||||
chown rvr:rvr cache
|
||||
sed -i -e "s/^user = .*$/user = rvr/g" -e "s/^group = .*$/group = rvr/g" /etc/php/7.4/fpm/pool.d/www.conf
|
||||
|
||||
set +e
|
||||
|
Loading…
Reference in New Issue
Block a user