Skip to content

Create wcoa Docker overlay in the wcoa repo - #31

Merged
pollardld merged 3 commits into
dockerdecouplefrom
dd3
Jul 14, 2026
Merged

Create wcoa Docker overlay in the wcoa repo#31
pollardld merged 3 commits into
dockerdecouplefrom
dd3

Conversation

@pollardld

@pollardld pollardld commented Jul 14, 2026

Copy link
Copy Markdown
Member

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:

  • Added Taskfile.yml with common tasks for building, starting, stopping, and managing the Dockerized stack for local development.
  • Introduced docker/.env.example to define required environment variables for the Docker Compose setup, improving configuration clarity and reproducibility.
  • Added docker/config.wcoa.docker.ini for Docker-focused application configuration, separating environment-specific settings from code.

Docker Compose and service orchestration:

  • Added docker/compose.yml to orchestrate the stack, including the main app, Geoportal (Tomcat), and Elasticsearch, with appropriate volumes, environment variables, and dependencies.
  • Updated docker/Dockerfile to 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:

  • Added 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.
  • Introduced XML template files for authentication and security configuration (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]

- 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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +9 to +11
# 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/*
Comment on lines +79 to +91
# 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
Comment thread docker/.env.example Outdated
DATA_CATALOG_ENABLED = False
CATALOG_TECHNOLOGY = GeoPortal2
CATALOG_PROXY =
CATALOG_SOURCE = http://192.168.0.40:9200
Comment thread docker/compose.yml
Comment on lines +60 to +64
- cluster.name=${CLUSTER_NAME}
- ELASTIC_PASSWORD=${ELASTIC_PASSWORD}
- bootstrap.memory_lock=true
- reindex.remote.whitelist=${ES_REINDEX_REMOTE_WHITELIST}
- xpack.security.enabled=false
@pollardld
pollardld merged commit d6b67bd into dockerdecouple Jul 14, 2026
@pollardld
pollardld deleted the dd3 branch July 14, 2026 18:44
Comment thread docker/compose.yml
- .env
environment:
- MP_PROJECT_CONFIG=/usr/local/apps/madrona-portal/apps/wcoa/docker/config.wcoa.docker.ini
volumes:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!

Comment thread docker/compose.yml
volumes:
- ./static:/vol/web/static
- ./media:/usr/local/apps/madrona-portal/media
- ../../../madrona-portal/marco:/usr/local/apps/madrona-portal/marco

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Comment thread docker/Dockerfile
FROM tomcat:9-jdk17
ARG BASE_IMAGE=ghcr.io/ecotrust/madrona-portal
ARG BASE_TAG=dockerdecouple
FROM ${BASE_IMAGE}:${BASE_TAG}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

Comment thread Taskfile.yml
@@ -0,0 +1,46 @@
version: "3"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what was the impetus for adding this file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants