2018-12-06 11:28:48 +00:00
|
|
|
# Installing vBBS
|
2018-11-03 13:05:33 +00:00
|
|
|
|
2018-12-06 11:28:48 +00:00
|
|
|
## TL;DR - use docker :)
|
2018-11-03 13:05:33 +00:00
|
|
|
|
2018-12-06 05:22:02 +00:00
|
|
|
Figure out where you will install this - can be anywhere, call this *$APP_DIR*
|
2018-11-03 13:05:33 +00:00
|
|
|
|
2018-12-06 11:28:48 +00:00
|
|
|
### Setup a MYSQL/MARIADB database
|
2018-12-06 05:22:02 +00:00
|
|
|
For docker, you can use the mariadb:latest image:
|
2018-11-03 13:05:33 +00:00
|
|
|
|
2018-12-06 05:22:02 +00:00
|
|
|
```docker
|
|
|
|
docker run --rm -itd --name=vbbs_db \
|
|
|
|
-v ${APP_DIR}/database:/var/lib/mysql \
|
|
|
|
-e MYSQL_ROOT_PASSWORD=secret -e MYSQL_USER=user -e MYSQL_PASSWORD=password -e MYSQL_DATABASE=database mariadb:latest
|
|
|
|
```
|
2018-11-03 13:05:33 +00:00
|
|
|
|
2018-12-06 05:22:02 +00:00
|
|
|
Check that docker started OK, it should look something like this (use `docker ps`):
|
2018-11-03 13:05:33 +00:00
|
|
|
|
2018-12-06 05:22:02 +00:00
|
|
|
```
|
|
|
|
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
|
|
|
fc2f32aaaa55 mariadb:10.3 "docker-entrypoint.s…" 4 seconds ago Up 3 seconds 3306/tcp vbbs_db
|
|
|
|
```
|
2018-11-03 13:05:33 +00:00
|
|
|
|
2018-12-06 11:28:48 +00:00
|
|
|
### Clone the git repository
|
2018-11-03 13:05:33 +00:00
|
|
|
|
2018-12-06 05:22:02 +00:00
|
|
|
```bash
|
|
|
|
mkdir -p ${APP_DIR}/composer
|
|
|
|
mkdir -p ${APP_DIR}/app
|
|
|
|
cd ${APP_DIR}/app
|
|
|
|
git clone http://dev.leenooks.net/bbs/vbbs.git .
|
|
|
|
```
|
2018-11-03 13:05:33 +00:00
|
|
|
|
2018-12-06 05:22:02 +00:00
|
|
|
(chown -R 33:33 ${APP_DIR}/composer ${APP_DIR}/app dirs if you use my docker image)
|
2018-11-03 13:05:33 +00:00
|
|
|
|
2018-12-06 05:22:02 +00:00
|
|
|
** Setup the application
|
|
|
|
cd ${APP_DIR}/app
|
|
|
|
cp .env.example to .env
|
2018-11-03 13:05:33 +00:00
|
|
|
|
2018-12-06 05:22:02 +00:00
|
|
|
edit and update the APP_PORT (something above 1024) and DB_* database entries:
|
2018-11-03 13:05:33 +00:00
|
|
|
|
2018-12-06 05:22:02 +00:00
|
|
|
```config
|
|
|
|
APP_PORT=6502
|
|
|
|
...
|
|
|
|
DB_CONNECTION=mysql
|
|
|
|
DB_HOST=vbbs_db
|
|
|
|
DB_PORT=3306
|
|
|
|
DB_DATABASE=database
|
|
|
|
DB_USERNAME=user
|
|
|
|
DB_PASSWORD=password
|
|
|
|
```
|
2018-11-03 13:05:33 +00:00
|
|
|
|
2018-12-06 11:28:48 +00:00
|
|
|
### Setup PHP
|
2018-12-06 05:22:02 +00:00
|
|
|
You're PHP will need SOCKETS and PCNTL and you'll need COMPOSER as well installed.
|
2018-11-03 13:05:33 +00:00
|
|
|
|
2018-12-06 05:22:02 +00:00
|
|
|
If you are using docker, you can use my PHP image, which has all three.
|
2018-11-03 13:05:33 +00:00
|
|
|
|
2018-12-06 11:28:48 +00:00
|
|
|
### Pre Setup
|
2018-12-06 05:22:02 +00:00
|
|
|
You need to run composer, and migrate to test connectivity to the database and seed it - you can do that in a single step
|
2018-11-03 13:05:33 +00:00
|
|
|
|
2018-12-06 05:22:02 +00:00
|
|
|
```docker
|
|
|
|
docker run --rm -u www-data -itd --link=vbbs_db --name=vbbs \
|
|
|
|
-v ${APP_DIR}/app/php:/var/www/html \
|
|
|
|
-v ${APP_DIR}/composer:/var/www/.composer/cache \
|
|
|
|
--entrypoint=/bin/bash registry.leenooks.net/leenooks/php:7.2-fpm-plus -c "composer install; php artisan migrate --seed"
|
|
|
|
```
|
2018-11-03 13:05:33 +00:00
|
|
|
|
2018-12-06 11:28:48 +00:00
|
|
|
### Start
|
2018-12-06 05:22:02 +00:00
|
|
|
Now, run the app, you need to map it from the host port (can be anything), into the container onto APP_PORT that you specified above.
|
2018-11-03 13:05:33 +00:00
|
|
|
|
2018-12-06 05:22:02 +00:00
|
|
|
For example, if you use 6502 for both:
|
2018-11-03 13:05:33 +00:00
|
|
|
|
2018-12-06 05:22:02 +00:00
|
|
|
```docker
|
|
|
|
docker run --rm -u www-data -itd --link=vbbs_db --name=vbbs -p 6502:6502 \
|
|
|
|
-v ${APP_DIR}/app/php:/var/www/html \
|
|
|
|
-v ${APP_DIR}/composer:/var/www/.composer/cache \
|
|
|
|
--entrypoint=/bin/bash registry.leenooks.net/leenooks/php:7.2-fpm-plus -c "php artisan server"
|
|
|
|
```
|
2018-11-03 13:05:33 +00:00
|
|
|
|
2018-12-06 05:22:02 +00:00
|
|
|
If you want to watch is on the console, you can remove the `d` from the option or use `docker attach`
|
2018-11-03 13:05:33 +00:00
|
|
|
|
2018-12-06 05:22:02 +00:00
|
|
|
If it started OK, you should see it running (use `docker ps`):
|
2018-11-03 13:05:33 +00:00
|
|
|
|
2018-12-06 05:22:02 +00:00
|
|
|
```
|
|
|
|
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
|
|
|
9916ee39d9b7 registry.leenooks.net/leenooks/php:7.2-fpm-plus "/bin/bash -c 'php a…" 13 minutes ago Up 13 minutes 22/tcp, 9000/tcp, 0.0.0.0:6502->6502/tcp vbbs
|
|
|
|
```
|
2018-12-06 11:28:48 +00:00
|
|
|
|
|
|
|
### Voila!
|
2018-11-03 13:05:33 +00:00
|
|
|
|
2018-12-06 05:22:02 +00:00
|
|
|
Use your videotex terminal and connect to your host on the APP_PORT that you used (eg: 6502)
|