Then to run the comex2 services in the simplest way just do:
```
cd services
python3 comex_main_backend.py
```
The form server is then accessible locally on `0.0.0.0:5000/services/user`
The tina api server is on `0.0.0.0:5000/services/api`
Check the parameters in `config/parametres_comex.ini`
Finally, simply configure the serving of your php|www documentroot in nginx (cf [detailed doc](https://github.com/moma/comex2/blob/master/doc/nginx_conf.md) for real-life conf).
-------
#### Advanced dev 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
```
# edit ini file to put the correct SQL_HOST (or IP)
nano config/parametres_comex.ini
```
Then just create the table following [the table specifications](https://github.com/moma/comex2/blob/master/doc/table_specifications.md)
###### If you want a dedicated mysql in docker
- Follow the detailed steps in [mysql_prerequisites](https://github.com/moma/comex2/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/comex2/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
```
# edit ini file to put it as DOORS_HOST and DOORS_PORT
nano config/parametres_comex.ini
```
###### 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
```
##### 3) Run the regomex app with gunicorn
```
bash comex-run.sh
```
The form server is then accessible locally on `0.0.0.0:9090/services/user/register`
**Remark:** the prefix `/services` and the user route `/user` can both be changed in the config file