Compare commits

..

21 Commits

Author SHA1 Message Date
c9c854ed41
fixup! add release generator script
All checks were successful
rvr-nextgen/pipeline/pr-master This commit looks good
2023-09-28 12:17:47 +02:00
0d57268700
delete deprecated dockerfiles 2023-09-28 12:17:23 +02:00
f6fc1021d5
remove deprecated scripts 2023-09-28 12:16:55 +02:00
1ff04d3e1e
fixup! add release generator script
Some checks failed
rvr-nextgen/pipeline/pr-master There was a failure building this commit
2023-09-28 12:16:38 +02:00
fdd1fa50ff
fixup! add release generator script
Some checks failed
rvr-nextgen/pipeline/pr-master There was a failure building this commit
2023-09-28 12:09:56 +02:00
5f381ecd63
add docker release stage to pipeline
Some checks failed
rvr-nextgen/pipeline/pr-master There was a failure building this commit
2023-09-28 12:04:49 +02:00
6d912268db
use the new dockerfile in pipeline 2023-09-28 12:03:23 +02:00
4ab0cd7be2
fixup! update soko-web 2023-09-28 11:57:38 +02:00
6440dea859
fixup! install base database in MigrateDatabaseCommand 2023-09-28 11:39:48 +02:00
35f7972cd4
fixup! add entry point for dev docker 2023-09-28 11:38:21 +02:00
7e12d32f9e
fixup! add entry point for release docker 2023-09-28 11:37:58 +02:00
984ae4dc27
fixup! update docker-compose 2023-09-28 11:36:16 +02:00
33deefdd9e
update soko-web 2023-09-28 11:33:37 +02:00
5eebaf8ec4
update docker-compose 2023-09-28 10:02:55 +02:00
9d459e0ab7
add new dockerfile with dev and release stages 2023-09-28 10:02:18 +02:00
47aaf3f3d6
add entry point for dev docker 2023-09-28 10:02:06 +02:00
17633c4005
add entry point for release docker 2023-09-28 10:02:00 +02:00
1c4c9420f8
add cron for db:maintain 2023-09-28 10:01:50 +02:00
41ba159bb1
add release generator script 2023-09-28 10:01:38 +02:00
644706616a
add nodejs installer script 2023-09-28 10:01:31 +02:00
c7ab923563
install base database in MigrateDatabaseCommand 2023-09-28 10:00:34 +02:00
2 changed files with 60 additions and 60 deletions

118
README.md
View File

@ -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.
---

View File

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