Environment Variables¶
All central configurations of the InfDB services are stored in the environment file .env in the project root. This enables modular configuration of the InfDB services.
Note
If you're using the default configuration, you can skip creating and editing the .env configuration file.
Before starting InfDB, you need to create the .env configuration file by copying from the template .env.template:
Edit the environment file .env to customize your InfDB instance settings (database credentials, ports, paths, etc.):
# ==============================================================================
# InfDB Docker Compose Configuration
# ==============================================================================
# This file contains all configuration parameters for the InfDB Docker setup.
# Copy this file to .env and customize the values as needed.
# ==============================================================================
# ==============================================================================
# SERVICE ACTIVATION
# ==============================================================================
# Select profiles to activate
# Base profiles
COMPOSE_PROFILES=db # (1)
# All profiles
# COMPOSE_PROFILES=db,admin,notebook,qwc,api # (2)
# ==============================================================================
# BASE CONFIGURATION
# ==============================================================================
# Base name for the project (used in network names and data paths)
BASE_NAME=infdb-demo # (3)
# ==============================================================================
# POSTGRESQL DATABASE (Core Service)
# ==============================================================================
# Profile: db
# Database name
SERVICES_POSTGRES_DB=infdb # (4)
# Database credentials
SERVICES_POSTGRES_USER=infdb_user # (5)
SERVICES_POSTGRES_PASSWORD=infdb # (6)
# Host:Port address from which a container is able to reach the Postgres database
SERVICES_POSTGRES_HOST=host.docker.internal # (7)
SERVICES_POSTGRES_EXPOSED_PORT=54328 # (8)
# EPSG code for spatial reference system (25832 = ETRS89 / UTM zone 32N)
SERVICES_POSTGRES_EPSG=25832 # (9)
# ==============================================================================
# PGADMIN (Database Administration Interface)
# ==============================================================================
# Profile: admin
# Default login credentials for pgAdmin
SERVICES_PGADMIN_DEFAULT_EMAIL=admin@need.energy # (10)
SERVICES_PGADMIN_DEFAULT_PASSWORD=infdb # (11)
# Port to expose pgAdmin on the host machine
SERVICES_PGADMIN_EXPOSED_PORT=82 # (12)
# ==============================================================================
# FASTAPI (REST API Service)
# ==============================================================================
# Profile: api
# Port for the FastAPI service
SERVICES_API_PORT=8000 # (13)
# ==============================================================================
# PYGEOAPI (OGC API Service)
# ==============================================================================
# Profile: api
# Port for the PyGeoAPI service
SERVICES_PYGEOAPI_PORT=8001 # (14)
# Host IP to run PyGeoAPI on (e.g., localhost or 10.162.28.144)
SERVICES_PYGEOAPI_BASE_HOST=localhost # (15)
# ==============================================================================
# POSTGREST (PostgreSQL REST API)
# ==============================================================================
# Profile: api
# Port for the PostgREST service
SERVICES_POSTGREST_PORT=8002 # (16)
# ==============================================================================
# JUPYTER NOTEBOOK (Development Environment)
# ==============================================================================
# Profile: notebook
# Port to expose Jupyter on the host machine
SERVICES_JUPYTER_EXPOSED_PORT=8888
# Enable Jupyter Lab interface (yes/no)
SERVICES_JUPYTER_ENABLE_LAB=yes
# Authentication token for Jupyter
SERVICES_JUPYTER_TOKEN=infdb # (19)
# Path to notebook files
SERVICES_JUPYTER_PATH_BASE=../src/notebooks/ # (20)
# ==============================================================================
# QGIS WEB CLIENT (QWC)
# ==============================================================================
# Profile: qwc
# Port for QWC web interface
SERVICES_QWC_EXPOSED_PORT_GUI=80 # (21)
# Port for QWC internal database
SERVICES_QWC_EXPOSED_PORT_DB=5434 # (22)
# Password for QWC PostgreSQL database
SERVICES_QWC_POSTGRES_PASSWORD=infdb # (23)
# JWT secret key for QWC (change this for production!)
JWT_SECRET_KEY=change-me-in-production # (24)
- Profiles: By default only the PostgreSQL core is activated. You can activate services by adding the needed profile name to this list.
- All Profiles: If you uncomment this line, all services will be activated.
- Project Name: Change the name to the purpose of your work so that the instance can be clearly recognized. This name needs to be unique.
- DB Name: Name of base postgres database.
- DB User: Admin user of postgres database.
- DB Password: Admin password of postgres database.
- DB Host: Internal parameter (usually
host.docker.internal). - DB Port: Port that exposes outside of docker and used to communicate with other applications.
- EPSG: Default coordinate reference system (CRS) for postgres database.
- pgAdmin Email: Admin user of pgAdmin web interface.
- pgAdmin Password: Admin password of pgAdmin web interface.
- pgAdmin Port: Port that exposes outside of docker and used to access via browser.
- API Port: Port that exposes outside of docker and used to communicate with other applications.
- PyGeoAPI Port: Port that exposes outside of docker and used to communicate with other applications.
- PyGeoAPI Host: Base URL for PyGeoAPI local:
localhost, remote:DOMAINorIP-ADDRESS-OF-REMOTE-HOST. - PostgREST Port: Port that exposes outside of docker.
- Jupyter Port: Port that exposes Jupyter outside of Docker.
- Jupyter Lab: Enables JupyterLab interface (
yes/no). - Jupyter Token: Authentication token for Jupyter access.
- Jupyter Path: Base path to notebook files.
- QWC GUI Port: Port that exposes the QWC web interface.
- QWC DB Port: Port that exposes the QWC internal database.
- QWC DB Password: Password for QWC PostgreSQL database.
- JWT Secret: Secret key used by QWC JWT authentication (must be changed for production).
Detailed configuration guide¶
Use this section as a practical checklist when editing .env.
1) Choose service profiles (COMPOSE_PROFILES)¶
The COMPOSE_PROFILES variable controls which containers are started.
- Minimal setup (database only):
- Typical local development setup:
- Full setup (all services):
Only enable what you need. Fewer profiles mean faster startup and fewer port conflicts.
2) Set a unique project name (BASE_NAME)¶
BASE_NAME is used in container, network, and volume naming.
If multiple InfDB instances run on the same machine, give each one a different value (for example infdb-city-a, infdb-city-b).
3) Configure PostgreSQL core settings¶
These values are required for all setups:
SERVICES_POSTGRES_DB=infdb
SERVICES_POSTGRES_USER=infdb_user
SERVICES_POSTGRES_PASSWORD=change-this-password
SERVICES_POSTGRES_HOST=host.docker.internal
SERVICES_POSTGRES_EXPOSED_PORT=54328
SERVICES_POSTGRES_EPSG=25832
Recommendations:
- Use a strong password for
SERVICES_POSTGRES_PASSWORD. - Keep the default host unless you know you need another one.
- Change
SERVICES_POSTGRES_EXPOSED_PORTif54328is already in use. - Set
SERVICES_POSTGRES_EPSGto the CRS your project uses.
4) Configure optional services¶
Only relevant if their profile is enabled.
pgAdmin (admin profile)¶
SERVICES_PGADMIN_DEFAULT_EMAIL=admin@example.com
SERVICES_PGADMIN_DEFAULT_PASSWORD=change-this-password
SERVICES_PGADMIN_EXPOSED_PORT=82
- Change credentials for any non-temporary setup.
- If port
82is occupied, select a free port (for example8082).
API services (api profile)¶
SERVICES_API_PORT=8000
SERVICES_PYGEOAPI_PORT=8001
SERVICES_PYGEOAPI_BASE_HOST=localhost
SERVICES_POSTGREST_PORT=8002
- Keep ports distinct.
- For remote access, set
SERVICES_PYGEOAPI_BASE_HOSTto your host/domain.
Jupyter (notebook profile)¶
SERVICES_JUPYTER_EXPOSED_PORT=8888
SERVICES_JUPYTER_ENABLE_LAB=yes
SERVICES_JUPYTER_TOKEN=change-this-token
SERVICES_JUPYTER_PATH_BASE=../src/notebooks/
- Always change the Jupyter token.
- Ensure
SERVICES_JUPYTER_PATH_BASEexists and is readable.
QWC (qwc profile)¶
SERVICES_QWC_EXPOSED_PORT_GUI=80
SERVICES_QWC_EXPOSED_PORT_DB=5434
SERVICES_QWC_POSTGRES_PASSWORD=change-this-password
JWT_SECRET_KEY=replace-with-long-random-secret
JWT_SECRET_KEYshould be long and random in production.- Avoid commonly used host ports if conflicts occur.
5) Validate before startup¶
Before running Docker Compose:
- Confirm all required variables for enabled profiles are set.
- Verify every exposed port is free.
- Replace all default passwords/tokens/secrets.
- Save the file as UTF-8 and keep variable names unchanged.
Then start the stack as usual.