Skip to content

Docker and Docker Compose

Dave Walker edited this page Aug 18, 2024 · 14 revisions

Overview

The Flight Recorder API and UI are available as Docker container images. Please see the following Docker Hub repositories for more information:

To run the Flight Recorder UI and the associated Web Service in Docker:

  • Create a folder to contain the key files, database and Docker Compose file
  • Create a database in that folder using the instructions in the "Database" section
  • Create a user in the database using the instructions in the "Database" section
  • Populate the country and airport lookup information using the instructions in the "Database" section
  • Create the RapidAPI key file and Docker Compose file in that folder, as described below
  • Create an "Export" folder to hold exported sightings
  • Create an "Export\Airports" folder to hold exported airport IATA code lists
  • Createan "Export\Reports" folder to hold exported report data

When completed, the folder structure should look as follows:

Flight Recorder Folder

RapidAPI Key

  • To enable data lookup via the AeroDataBox (see the sections on "External APIConfiguration" and "Application Configuration File"):
    • Sign up for a RapidAPI key at RapidAPI
    • Create a text file called "rapidapi.key" containing a single line holding the key
  • If the data lookup isn't being used, skip this step

Create the Docker Compose file

  • The following is an example Docker Compose file that can be used to run the Flight Recorder service and UI from the published Docker images
  • It should be saved as "docker-compose.yml" in the folder containing the other files, created in the previous steps
version: "3.7"

services:
  flight-ui:
    container_name: flightrecordermvc
    image: davewalker5/flightrecordermvc:latest
    restart: always
    ports:
      - "8083:80"
    networks:
      - flightrecorder-network
    depends_on:
      - flight-api

  flight-api:
    container_name: flightrecorderservice
    image: davewalker5/flightrecorderapisqlite:latest
    restart: always
    ports:
      - "8093:80"
    volumes:
      - C:\MyApps\FlightRecorder:/var/opt/flightrecorder.api/
    networks:
      - flightrecorder-network

networks:
  flightrecorder-network:
    driver: bridge
  • Make sure the "flight-ui" port number, 8083 in this example, is an unused port on the local machine
  • The example assumes that the Docker Compose file, database and RapidAPI key files are in the following folder:
C:\MyApps\FlightRecorder
  • This should be changed as appropriate
  • To start the application, open a terminal window, change to the folder and run the following command:
docker compose --project-directory . up -d
  • The output should look similar to this:
C:\FlightRecorder>docker compose --project-directory . up -d
[+] Building 0.0s (0/0)                                                                                                                                              docker:default
[+] Running 3/3
 ✔ Network flightrecorder_flightrecorder-network  Created                                                                                                                      0.1s
 ✔ Container flightrecorderservice                Started                                                                                                                      0.1s
 ✔ Container flightrecordermvc                    Started                                                                                                                      0.0s
  • With the application running, browsing to the following URL should show the login page:
http://localhost:8083
  • Replace the port number, 8083, with the port used for the "flight-ui" in the Docker Compose file
  • To stop the application, from the same folder run the following command:
docker compose --project-directory . down
  • The output should look similar to this:
C:\FlightRecorder>docker compose --project-directory . down
[+] Running 3/3
 ✔ Container flightrecordermvc                    Removed                                                                                                                      0.4s
 ✔ Container flightrecorderservice                Removed                                                                                                                      0.5s
 ✔ Network flightrecorder_flightrecorder-network  Removed
Clone this wiki locally