Sign inSign up

ogndocker/ogn-gateway-web

By ogndocker

Updated about 8 years ago

OGN web server serving data from statistics database

Image
0

1.3K

ogndocker/ogn-gateway-web repository overview

ogn-gateway-web

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

The docker file

How to Use This Image

The simplest
$ 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.

Specify the location of 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.

Using docker-compose
Running standalone container

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
Running a service (ogn-gateway-stats + web)

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

 

Environment variables

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

  • OGN_GATEWAY_STATS_DB_PATH - in order to set the location of the statistics database.
  • OGN_GATEWAY_IGC_BASE_URL -
  • OGN_GATEWAY_IGC_FILES_BASE_URL -

License

This project is MIT Licensed.

Tag summary

Content type

Image

Digest

Size

69.8 MB

Last updated

about 8 years ago

docker pull ogndocker/ogn-gateway-web