OGN web server serving data from statistics database
1.3K
A Docker image containing a standalone spring-boot application with web server serving chart and JSON documents with data taken from the statistics database.
For more detailed description of the application refer to the wiki page
$ docker run -d ogndocker/ogn-gateway-web
Note If you run it as described above the gateway will be looking for statistics database inside the container and normally will create an empty (since it doesn't find it). Fine, the app will work, but both the charts and the JSON docs served will be empty. Most likely not what you expect. You can change it by mounting external volume with the statistics database.
$ docker run -d -it -v 'C:/tmp/ogn/stats-db:/db' \
--rm -h ogn-gateway-web \
-e OGN_GATEWAY_STATS_DB_PATH=/db/ogn-stats.db \
-p 8080:8080 ogndocker/ogn-gateway-web
In the above example, we run ogn-gateway-web container and C:\tmp\ogn\stats-db volume will be mounted (mount point /db). This is where statistics database is expected. We expose the port 8080 - this is the default HTTP port to be used for the requests.
Create your docker-compose.yml
version: '2'
services:
ogn-gateway-web:
image: ogndocker/ogn-gateway-web:latest
hostname: ogn-gateway-web
ports:
- "8080:8080"
environment:
- OGN_GATEWAY_STATS_DB_PATH=/db/ogn-stats.db
volumes:
- "C:/tmp/ogn/stats-db:/db"
(Note: of course update the volume paths accordingly to your needs)
Then (while in the folder where your docker-compose.yml file is located) run:
$ docker-compose up -d
Often you might want to start both: The ogn-gateway-stats which will be producing statistics and writing them into the statistics database + the ogn-gateway-web app which will be serving data from that database as a response to your clients requests.
This docker-compose.yml should do the job:
version: '2'
services:
ogn-gateway-stats:
image: ogndocker/ogn-gateway-stats:latest
hostname: ogn-gateway-stats
environment:
- OGN_GATEWAY_SIMULATION=false
- OGN_GATEWAY_LOG_DIR=/var/log/ogn-gateway
- OGN_GATEWAY_STATS_DB_PATH=/db/ogn-stats.db
ports:
- "61628:61628"
volumes:
- "C:/tmp/ogn/ogn-gateway/log/:/var/log/ogn-gateway"
- "C:/tmp/ogn/stats-db:/db"
ogn-gateway-web:
image: ogndocker/ogn-gateway-web:latest
hostname: ogn-gateway-web
ports:
- "8080:8080"
environment:
- OGN_GATEWAY_STATS_DB_PATH=/db/ogn-stats.db
volumes:
- "C:/tmp/ogn/stats-db:/db"
links:
- ogn-gateway-stats
Like in the above example, you can tune the default behavior of the gateway, by passing some environment variables (either directly or in your docker-compose file
This project is MIT Licensed.
Content type
Image
Digest
Size
69.8 MB
Last updated
about 8 years ago
docker pull ogndocker/ogn-gateway-web