How g3w-suite/g3w-suite-docker works
1. What this repository is
- This repo is not the GIS application itself; it is the Docker-based deployment layer for G3W-SUITE, a self-hosted web GIS stack.
- Its main job is to assemble, configure, and operate the runtime environment around the application.
2. Top-level runtime topology
- The system is centered on a Docker Compose stack with multiple variants:
- docker-compose.yml for production/default
- docker-compose-dev.yml for development
- docker-compose-consumer.yml for batch/consumer mode
- The stack is designed to run a browser-facing web app behind a reverse proxy, with a database and supporting services alongside it.
3. Core application service
- The main application container is built from Dockerfile.g3wsuite.dockerfile.
- It runs the G3W-SUITE backend via Gunicorn; the startup path is explicitly:
- image build
- scripts/setup.sh
- scripts/docker-entrypoint.sh
- Gunicorn process
- The app appears to be a Python/Django-based service, with a custom settings layer in config/g3w-suite/settings_docker.py.
4. Reverse proxy and HTTP/HTTPS edge
- config/nginx contains the Nginx configuration and served error pages.
- Nginx acts as the external entrypoint for the stack, handling:
- HTTP routing to the app
- optional SSL termination
- static/error assets
- HTTPS is optionally enabled with Let’s Encrypt, using run_certbot.sh and scripts/makefile/renew-ssl.sh.
5. Spatial data persistence
- The data store is PostgreSQL with PostGIS; the README notes a migration from PostgreSQL/PostGIS 11/2.5 to 16/3.4 in v3.8.
- Database access and operational state are persisted through shared-volume and secrets, indicating the stack keeps durable state outside the ephemeral containers.
- Backup/restore is a first-class operational concern, with scripts under scripts/makefile/.
6. Async/batch processing path
- The README explicitly mentions Huey for batch processing and a separate consumer stack (docker-compose-consumer.yml).
- This means the architecture supports an asynchronous worker mode in addition to the request/response web path.
- Redis is likely the coordination/cache/message component for this background work, based on the provided service access commands and common G3W-SUITE deployment layout.
7. GIS server/runtime dependencies
- The repo includes a dedicated build path for QGIS Server dependencies and an Oracle-specific QGIS server image:
- Dockerfile.g3wsuite-deps*.dockerfile
- docker/Dockerfile.qgis-server-oracle.dockerfile
- This suggests the stack has a GIS rendering/service layer that depends on QGIS runtime components and may support multiple backend database/vendor variants.
8. Image build pipeline
- The repository separates base dependencies from the final application image:
- dependency image build first
- main app image build second
- GitHub Actions workflows automate build/test/push for:
- main image
- LTR dependencies
- backports
- test builds
- This is a container-image-first architecture rather than a source-only deployment.
9. Configuration and override boundaries
- The deployment is highly configurable through mounted files rather than code changes:
- config/g3w-suite/overrides/templates
- config/g3w-suite/overrides/static/style.css
- config/g3w-suite/settings_docker.py
- config/qgis/QGIS3.ini
- These are the main “customization seams” for branding, app settings, and QGIS behavior.
10. Secrets and host integration
- Sensitive runtime files live under secrets/, including:
- PostgreSQL service configuration
- QGIS auth database
- passwords
- This points to a deployment model where containers consume host-provided credentials and auth material rather than baking secrets into images.
11. Operational scripts and lifecycle tooling
- scripts/docker-entrypoint*.sh, scripts/setup.sh, and the Makefile-oriented helpers are the operational glue.
- The repo also includes utility scripts for:
- database backup/restore
- SSL renewal
- debugger attachment
- container entrypoint variations for dev/consumer modes
12. How data flows through the system
- External browser traffic enters via Nginx.
- Nginx forwards app requests to the G3W-SUITE Gunicorn service.
- The app reads/writes spatial and application state in PostgreSQL/PostGIS.
- Background jobs, when enabled, run in the consumer worker path and coordinate through the async stack.
- QGIS-related rendering/server functionality depends on the QGIS runtime and its configuration mounted into the containers.
13. Important diagram boundaries
- A good architecture diagram should clearly separate:
- the edge proxy layer
- the web application container
- the spatial database
- the async worker/consumer path
- the build-time image pipeline
- the host-mounted config/secrets volumes
- The repo’s main concern is not application logic, but the packaging and orchestration boundaries around a GIS platform.
Main entry points: Dockerfile.g3wsuite.dockerfile G3W app · docker-compose.yml Compose stack · nginx.conf Nginx edge · build_and_push_main_image.yml GitHub Actions
Components 24
Runtime stack
Containerized services and request/data flows
- Compose stack · Primary production deployment topology
docker-compose.yml - Dev stack · Development-focused compose variant
docker-compose-dev.yml - Consumer stack · Batch/worker compose variant for async processing
docker-compose-consumer.yml - Nginx edge · External HTTP/HTTPS entrypoint and routing layer
config/nginx/nginx.conf - G3W app · Main application container running Gunicorn
Dockerfile.g3wsuite.dockerfile - PostGIS DB · Persistent spatial data store for the platform
- Huey worker · Background job consumer for batch processing
docker-compose-consumer.yml - Redis · Async coordination/cache backend used by background work
docker-compose-consumer.yml - QGIS runtime · QGIS server dependencies and vendor-specific runtime image
docker/Dockerfile.qgis-server-oracle.dockerfile
Build pipeline
Image builds and CI workflows
- Deps image · Shared dependency layer built before the app image
Dockerfile.g3wsuite-deps.dockerfile - LTR deps · Long-term-support dependency image variants
Dockerfile.g3wsuite-deps.ltr.dockerfile - App image · Final application image built from dependencies and app sources
Dockerfile.g3wsuite.dockerfile - GitHub Actions · Automated build, test, and push workflows
.github/workflows/build_and_push_main_image.yml
Config and secrets
Mounted configuration, secrets, and runtime state
- App settings · Docker-specific application settings override
config/g3w-suite/settings_docker.py - QGIS config · Mounted QGIS runtime configuration
config/qgis/QGIS3.ini - Nginx assets · Nginx locations, SSL, and error-page assets
config/nginx - Secrets · Host-provided passwords, service config, and auth database
secrets - Shared volume · Persistent runtime files including Gunicorn config
shared-volume
Operations
Lifecycle, backup, SSL, and debugging tools
- Setup entry · Container initialization and environment preparation
scripts/setup.sh - App entrypoint · Main container startup path before Gunicorn
scripts/docker-entrypoint.sh - Worker entry · Startup path for the consumer/batch container
scripts/docker-consumer-entrypoint.sh - SSL renewal · Let’s Encrypt certificate renewal helper
scripts/makefile/renew-ssl.sh - DB ops · Backup and restore helpers for the spatial database
scripts/makefile/db-backup.sh - Debug tools · Gunicorn debugger attachment utilities
scripts/debugger/gunicorn_debugger.py
Connections 32
- Compose stack → Nginx edge: runs · Production compose stack starts the reverse proxy
- Compose stack → G3W app: runs · Production compose stack starts the application service
- Compose stack → PostGIS DB: uses · Application persists state in PostgreSQL/PostGIS
- Compose stack → Secrets: mounts · Stack injects host-managed secrets
- Compose stack → Shared volume: mounts · Stack shares durable runtime files
- Dev stack → G3W app: runs · Development variant runs the app with dev entrypoints
- Dev stack → Nginx edge: runs · Development variant can include proxy-facing routing
- Consumer stack → Huey worker: runs · Consumer compose starts the background worker
- Huey worker → Redis: coordinates with · Worker uses Redis for async coordination
- Nginx edge → G3W app: forwards to · Nginx proxies web requests to Gunicorn
- Nginx edge → QGIS runtime: serves · Edge layer exposes GIS-related runtime services through containerized backend components
- G3W app → PostGIS DB: reads/writes · Application stores domain and spatial data in PostGIS
- G3W app → QGIS runtime: depends on · Application stack depends on QGIS runtime and settings
- G3W app → App settings: loads · Docker-specific configuration overrides are mounted into the app
- G3W app → Setup entry: starts with · Container bootstrap begins with setup script
- G3W app → App entrypoint: starts with · Entrypoint hands off to Gunicorn startup
- Huey worker → Worker entry: starts with · Worker container uses dedicated entrypoint
- QGIS runtime → QGIS config: configured by · QGIS behavior is controlled by mounted ini config
- Nginx edge → Nginx assets: configured by · Nginx uses custom configs, SSL, and error assets
- G3W app → Shared volume: reads · App uses shared runtime state such as Gunicorn config
- G3W app → Secrets: reads · App consumes credentials and auth material from secrets
- PostGIS DB → DB ops: managed by · Backup and restore scripts operate on the database state
- Nginx edge → SSL renewal: managed by · Certificate renewal supports HTTPS termination
- App image → Deps image: built from · Final application image layers on shared dependencies
- App image → G3W app: packages · Main image packages the application runtime
- LTR deps → Deps image: variant of · LTR dependency image is a related base build
- GitHub Actions → Deps image: builds · CI automates dependency image builds
- GitHub Actions → App image: builds · CI automates main image build and push
- GitHub Actions → LTR deps: builds · CI automates LTR dependency variants
- GitHub Actions → Compose stack: tests · Workflow validates compose-based builds
- Debug tools → G3W app: attaches to · Debugger utilities target the Gunicorn app process
- DB ops → PostGIS DB: operates on · Database backup and restore target the spatial store