@@ -52,40 +54,67 @@ The form server is then accessible locally on `127.0.0.1:5000/regcomex`
-------
Or, to run the app with a real-world config:
- gunicorn webserver
- external mysql database
- external doors (simulated by docker)
#### Real-world config
1. external mysql database
2. external doors (or simulated by docker)
3. gunicorn webserver (linked to 1 & 2 via `$SQL_HOST` and `$DOORS_HOST`)
##### 1) Set up your mysql database
###### If you have your own local mysql
```
# install more prerequisites
sudo apt install docker jq
export SQL_HOST=localhost # or any other hostname/IP
```
Then just create the table following [the table specifications](https://github.com/moma/regcomex/blob/master/doc/table_specifications.md)
cd $INSTALL_DIR
source setup/regcomex_config.ini
###### If you want a dedicated mysql in docker
# external mysql setup
mkdir ../shared_mysql_data
- Follow the detailed steps in [mysql_prerequisites](https://github.com/moma/regcomex/blob/master/setup/dockers/mysql_prerequisites.md): it will explain how to create the docker and connect to it.
- Then create the table following [the table specifications](https://github.com/moma/regcomex/blob/master/doc/table_specifications.md)
Again, the environment variable `DOORS_HOST` must simply be set to the doors server's hostname or IP, and `DOORS_PORT` to the doors server's exposed port.
###### If you have a doors server
```
export DOORS_HOST=yourdoorsserver
export DOORS_PORT=8989
```
###### If you have no doors server
For tests you can use a `minidoors` container
```
# build the docker image (once)
cd setup/dockers
docker build -t minidoors:latest minidoors/
# run the container (each time)
docker run -it -p 32789:8989 --name doors_test minidoors
# here also set up the doors connection
# pass the info to the env before running regcomex
#### To make a docker with the mysql instead of using your local mysql server
## Sql config tips
If you have an sql running, just fill your sql hostname in `$SQL_HOST` and skip to [Set up the tables](https://github.com/moma/regcomex/blob/master/doc/table_specifications.md).
#### Prerequisites
We'll use docker and jq here
```
# install prerequisites
sudo apt install docker jq
```
#### To build and run a `comex_db` container with the mysql