Skip to main content

Installation with Docker

This document describes the complete installation of the application with Docker and Docker Compose.

Prerequisites

Linux machine with Docker, or Windows with Docker installed within WSL, cf. Get started with Docker remote containers on WSL 2.

Configuration

$ cp .env.db.example .env.db
$ cp .env.production.local.example .env.production.local

Then edit the .env.db file to enter a password for the PostgreSQL database.

Next, modify the .env.production.local file:

Database connection

  • DB_HOST: host
  • DB_PORT: port
  • DB_NAME: database name
  • DB_USER: role
  • DB_PASS: password
  • DB_SCHEMA=lebontag: schema (do not modify)
  • DB_SRID=4326: coordinate system (do not modify)

For Docker, use the following parameters:

DB_HOST=db
DB_PORT=5432
DB_NAME=postgres
DB_USER=postgres
DB_PASS=$POSTGRES_PASSWORD

Authentication

  • AUTH_URL: Application URL
  • AUTH_TRUST_HOST=true: Do not modify
  • AUTH_DEBUG: Debug mode
  • AUTH_SECRET: Unique installation hash. Use openssl rand -hex 32 to generate one.

Finally, you must configure at least one external authentication provider. See the URLs for each one listed in the file.

  • AUTH_XXX_ID: ID of authentication provider XXX
  • AUTH_XXX_SECRET: Secret of authentication provider XXX

Additional providers can be added in the /src/auth.ts file (advanced).

Replication

Specify the URL of the OSM data to download and the URL for the minut replication of this data on download.openstreetmap.fr, for example:

OSM_DATA_URL=https://download.openstreetmap.fr/extracts/europe/switzerland/geneva.osm.pbf
OSM_REPL_SERVER_URL=https://download.openstreetmap.fr/replication/europe/switzerland/geneva/minute/

Building Docker container images

$ docker compose build

Starting the application

$ docker compose up -d

First loading of OSM data

$ docker compose up initializer

First user

Log in to the application with the previously configured authentication service.

To make this first user an administrator (after they log in), run:

$ docker compose up make-first-user-admin

Logging

  • /log/lbt-autovalidation: self-validated OSM objects
  • /log/lbt-fetch: retrieval of modified OSM objects
  • /log/lbt-footprints-intersection: intersection between modified objects and footprints
  • /log/lbt-load-data: loading of reference data
  • /log/lbt-update-db-by-osc: database update by validated objects

Variation for development

The web application can be started in ‘development’ mode in order to benefit from hot reload. To do this:

$ cp .env.development.local.example .env.development.local

Then modify the .env.development.local file to fill in the various environment variables.

Start the application with the following command:

docker compose -f docker-compose.yml -f docker-compose.dev.yml up -d

[!note] At present, Python components that perform data processing tasks do not benefit from hot reload.