Create wcoa Docker overlay in the wcoa repo - #31
Conversation
- Update .gitignore to exclude new configuration files and directories - Create Taskfile.yml for managing Docker tasks - Add .env.example for environment variable configuration - Modify Dockerfile to support new build context and dependencies - Introduce docker-compose.yml for orchestrating services - Add config.wcoa.docker.ini for application-specific settings - Implement geoportal-entrypoint.sh for application startup and configuration - Create authentication and security XML templates for user management
There was a problem hiding this comment.
Pull request overview
This PR adds a Docker-based local development overlay for the WCOA Portal stack, further decoupling WCOA from the madrona-portal repo by providing compose orchestration, environment/config management, and Geoportal security template generation.
Changes:
- Added a Taskfile-driven workflow to build and run the Docker Compose stack locally.
- Introduced Docker Compose + env/config files for WCOA local dev configuration.
- Added Geoportal template files and an entrypoint script to generate security/auth config at runtime.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
Taskfile.yml |
Adds common Task tasks to build and run the composed WCOA stack. |
docker/compose.yml |
Defines the WCOA app + Geoportal + Elasticsearch orchestration and volumes. |
docker/Dockerfile |
Builds a WCOA overlay image on top of a Madrona Portal base image and installs WCOA deps. |
docker/.env.example |
Provides example environment variables for local Docker runs. |
docker/config.wcoa.docker.ini |
Adds a Docker-focused app configuration file for WCOA local development. |
docker/geoportal-entrypoint.sh |
Generates Geoportal/Harvester security config from templates during container startup. |
docker/templates/authentication-simple.xml |
Adds a template for simple (user-service) auth configuration. |
docker/templates/catalog-app-security.xml |
Adds a template for Geoportal catalog Spring Security config. |
docker/templates/harvester-app-security.xml |
Adds a template for Harvester Spring Security config. |
.gitignore |
Updates ignored paths/files for local config and Docker-generated artifacts. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Install gettext for envsubst command | ||
| echo "Installing gettext package for environment variable substitution..." | ||
| apt-get update -qq && apt-get install -y gettext-base && apt-get clean && rm -rf /var/lib/apt/lists/* |
| # Use envsubst to replace environment variables | ||
| envsubst < "$template_file" > "$output_file" | ||
|
|
||
| if [ $? -eq 0 ]; then | ||
| echo "Successfully processed $template_file" | ||
|
|
||
| # Show a sample of the processed content for verification | ||
| echo "Sample of processed content:" | ||
| grep -E "(frame-options|Content-Security-Policy)" "$output_file" | head -2 | sed 's/^/ /' | ||
| else | ||
| echo "ERROR: Failed to process $template_file" | ||
| return 1 | ||
| fi |
| DATA_CATALOG_ENABLED = False | ||
| CATALOG_TECHNOLOGY = GeoPortal2 | ||
| CATALOG_PROXY = | ||
| CATALOG_SOURCE = http://192.168.0.40:9200 |
| - cluster.name=${CLUSTER_NAME} | ||
| - ELASTIC_PASSWORD=${ELASTIC_PASSWORD} | ||
| - bootstrap.memory_lock=true | ||
| - reindex.remote.whitelist=${ES_REINDEX_REMOTE_WHITELIST} | ||
| - xpack.security.enabled=false |
| - .env | ||
| environment: | ||
| - MP_PROJECT_CONFIG=/usr/local/apps/madrona-portal/apps/wcoa/docker/config.wcoa.docker.ini | ||
| volumes: |
There was a problem hiding this comment.
I'm curious about one day not having all of these other repos checked in as volumes. I feel like installing them with pip might be an alternative.
Not saying we need to solve this now, just something I am curious about!
| volumes: | ||
| - ./static:/vol/web/static | ||
| - ./media:/usr/local/apps/madrona-portal/media | ||
| - ../../../madrona-portal/marco:/usr/local/apps/madrona-portal/marco |
There was a problem hiding this comment.
Is the eventual idea to remove this line of adding the marco volume?
| # Docker-focused configuration for WCOA local development. | ||
| # Use with MP_PROJECT_CONFIG=config.wcoa.docker.ini | ||
|
|
||
| [APP] |
There was a problem hiding this comment.
I'm curious about what should go in the .ini vs .env files. Should the variables that are blank here be better off as .env variables?
| FROM tomcat:9-jdk17 | ||
| ARG BASE_IMAGE=ghcr.io/ecotrust/madrona-portal | ||
| ARG BASE_TAG=dockerdecouple | ||
| FROM ${BASE_IMAGE}:${BASE_TAG} |
| @@ -0,0 +1,46 @@ | |||
| version: "3" | |||
There was a problem hiding this comment.
what was the impetus for adding this file?
Continue Docker decoupling of wcoa from madrona-portal.
This pull request introduces a new, Docker-based local development environment for the WCOA Portal and Geoportal applications. It includes Docker Compose configuration, environment variable management, and dynamic generation of security and authentication settings for the Geoportal and Harvester services. The changes modularize the setup, making it easier to configure, run, and maintain the development environment.
Local development environment setup:
Taskfile.ymlwith common tasks for building, starting, stopping, and managing the Dockerized stack for local development.docker/.env.exampleto define required environment variables for the Docker Compose setup, improving configuration clarity and reproducibility.docker/config.wcoa.docker.inifor Docker-focused application configuration, separating environment-specific settings from code.Docker Compose and service orchestration:
docker/compose.ymlto orchestrate the stack, including the main app, Geoportal (Tomcat), and Elasticsearch, with appropriate volumes, environment variables, and dependencies.docker/Dockerfileto build the app image based on the core Madrona Portal image, install WCOA code and dependencies, and set the project config environment variable.Geoportal security and configuration automation:
docker/geoportal-entrypoint.sh, a robust entrypoint script for the Geoportal container that waits for WAR deployment, processes XML security templates using environment variables, and ensures proper Tomcat startup/shutdown for development.docker/templates/authentication-simple.xml,catalog-app-security.xml,harvester-app-security.xml), with environment variable substitution to enable dynamic, environment-specific security policies. [1] [2] [3]