README.md 1.62 KB
Newer Older
František Kolovský's avatar
doc    
František Kolovský committed
1
2
## Traffic Modeler (TraMod)
Project website: [trafficmodeller.com](https://trafficmodeller.com/)
3
4

### Run Application
František Kolovský's avatar
Docker    
František Kolovský committed
5
Rename `api/src/main/resources/application.template.properties` to `api/src/main/resources/application.properties` and set the properties.
František Kolovský's avatar
František Kolovský committed
6
The application needs more stack memory. It is recommended set `-Xss32m`.
7
8
9
10

For Linux:
```bash
./gradlew build
František Kolovský's avatar
František Kolovský committed
11
./gradlew bootRun
12
13
```

František Kolovský's avatar
doc    
František Kolovský committed
14
15
16
17
### Documentation
The REST API description: [doc/new_api.md](doc/api_new.md)
<br>The deprecated API version: [doc/api.md](doc/api.md)
<br>General documentation: [doc/doc.md](doc/doc.md)
18

František Kolovský's avatar
Docker    
František Kolovský committed
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
The swagger UI documentation is available on [http://localhost:8080/swagger-ui.html](http://localhost:8080/swagger-ui.html).

### Docker
Build JAR:
```bash
bash gradlew bootJar
```
Build Docker image:
```bash
docker build -t tramod/latest .
```

Run the Docker container with name `tramod` and with API-KEY `aaa`:
```bash
docker run
-p 8080:8080
--env TM_DB_URL=jdbc:postgresql://host:5432/database?user=username&password=password
--env TM_SECURITY_API-KEY=aaa
--name tramod
tramod/latest
```
All properties from `application.properies` can be rewrote using `--env PROPERTY_NAME=value`. Thus
```
TM_DB_URL=jdbc:postgresql://server:5432/stm?user=user&password=password
TM_DB_LOADTURNREStrictions=false
TM_B_MAXIMALJOBSCOUNT=10
TM_B_MAXIMALITERATIONSCOUNT=10
TM_B_EPSILON=10E-3
TM_B_THREADSCOUNT=2
TM_B_MAXIMALRESULTAGE=86400000
TM_B_MAXIMALRESULTSCOUNT=100
TM_ODM_COMBINEDDETERRENCEFUNCTIONALPHA=1.0
TM_ODM_COMBINEDDETERRENCEFUNCTIONBETA=1.0
TM_SECURITY_API-KEY=secret-key
```
#### Docker Compose
Run application together with database using docker-compose:
```bash
docker-compose up
```