Skip to content

WCOA Docker Decoupled from Madrona Portal - #37

Draft
pollardld wants to merge 22 commits into
mainfrom
dockerdecouple
Draft

WCOA Docker Decoupled from Madrona Portal#37
pollardld wants to merge 22 commits into
mainfrom
dockerdecouple

Conversation

@pollardld

@pollardld pollardld commented Jul 29, 2026

Copy link
Copy Markdown
Member

This PR introduces a new Docker set up for madrona portals. ocean portals now overlay the core platform madrona-portal. This is a portal-specific repo (wcoa) that builds an overlay images on top of the shared core.

This PR should be merged only after Ecotrust/madrona-portal#62 as been merged.

--
Copilot:

This pull request introduces a comprehensive Docker-based development and deployment workflow for the WCOA project. It adds configuration, orchestration, and automation files for building, running, and managing the application stack using Docker Compose, including both development and production environments. The changes decouple the application from the Tomcat-based legacy setup, streamline environment variable management, and provide clear developer instructions.

Dockerization and Environment Management

  • Added docker/compose.yml and docker/compose.prod.yml to define development and production multi-container stacks, including services for the Django app, Geoportal, Elasticsearch, PostGIS, Redis, and supporting tools like Kibana and Nginx. [1] [2]
  • Introduced .env.example for environment variable management and a Docker-focused config.wcoa.docker.ini for application configuration. [1] [2]

Build and CI/CD Automation

  • Added a GitHub Actions workflow (.github/workflows/build-and-publish-image.yml) to automate building and publishing the WCOA image to GHCR on push.
  • Added a Taskfile.yml to provide developer-friendly commands for building, running, and managing the Docker stack.

Docker Image and Entrypoint Improvements

  • Refactored docker/Dockerfile to use a base overlay approach, installing WCOA as an editable package and supporting additional requirements.
  • Added a robust geoportal-entrypoint.sh script to handle Tomcat/Geoportal environment variable substitution and configuration templating at runtime.

Developer Experience

  • Updated README.md with a Docker quickstart guide for local development using the new workflow.
  • Added an empty docker/requirements.txt as a placeholder for project-specific Python dependencies.

pollardld added 22 commits July 13, 2026 16:44
- 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
Create wcoa Docker overlay in the wcoa repo
Add db-restore script for PostgreSQL dump restoration in WCOA Docker DB
Refactor Docker compose configuration to run multiple portals at same time
Production Docker compose, GitHub workflow for GHCR, and quickstart docs
Update BASE_TAG in build-and-publish-image.yml and improve environmen…
Update BASE_TAG in build-and-publish-image.yml to a specific commit SHA

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 restructures WCOA’s container workflow to build a portal-specific “overlay” image on top of the shared madrona-portal base, adding Docker Compose stacks, environment templates, helper scripts, and CI publishing to GHCR.

Changes:

  • Added dev/prod Docker Compose definitions and a base/overlay Dockerfile approach for WCOA.
  • Introduced local developer tooling (Taskfile) and helper scripts (DB restore), plus updated README quickstart.
  • Added Geoportal runtime templating and Spring Security templates for Geoportal/Harvester, plus a GHCR build/publish workflow.

Reviewed changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
Taskfile.yml Adds task shortcuts for building the base image and running the compose stack.
scripts/db-restore.sh Adds a DB restore helper for the decoupled Docker DB.
README.md Adds a Docker quickstart section.
docker/templates/harvester-app-security.xml Adds Spring Security config template for Harvester.
docker/templates/catalog-app-security.xml Adds Spring Security config template for Geoportal catalog + STAC + metadata routes.
docker/templates/authentication-simple.xml Adds a simple static-user auth template driven by env vars.
docker/requirements.txt Adds overlay-only Python requirements placeholder.
docker/geoportal-entrypoint.sh Adds a Geoportal entrypoint that templates Spring XML config at runtime.
docker/Dockerfile Switches to building an overlay on top of madrona-portal base image and installs WCOA in editable mode.
docker/config.wcoa.docker.ini Adds Docker-oriented WCOA app configuration defaults.
docker/compose.yml Introduces dev compose overlay (app + geoportal + elastic).
docker/compose.prod.yml Introduces prod compose stack (app + db + redis + geoportal + elastic + optional kibana/nginx).
docker/.env.example Adds example environment variables for the new docker workflow.
.gitignore Updates ignores for docker artifacts/config.
.github/workflows/build-and-publish-image.yml Adds CI build/publish workflow for the WCOA image.
Comments suppressed due to low confidence (1)

docker/.env.example:36

  • authentication-simple.xml references ${gpt_wcoa_username} / ${gpt_wcoa_password}, but those variables are missing from docker/.env.example. That will lead to unresolved placeholders (or empty credentials) when starting Geoportal/Harvester with the example env file.
gpt_admin_username=
gpt_admin_password=
gpt_publisher_username=
gpt_publisher_password=

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docker/compose.yml
Comment on lines +16 to +18
- type: bind
source: ../../../madrona-portal/marco
target: /usr/local/apps/madrona-portal/marco
Comment thread docker/.env.example
gpt_catalog_war=./wars/geoportal.war
gpt_harvester_war=./wars/harvester.war
gpt_frame_options=DENY
gpt_allowed_origin="localhost localhost:* *.westcoastoceans.org *.ecotrust.org 52.33.200.130"
Comment thread docker/requirements.txt
Comment on lines +1 to +2
# Project-only Python dependencies for mida Docker image.
# Leave empty unless mida requires packages not already in the base image. No newline at end of file
Comment on lines +57 to +58
DEFAULT_FROM_EMAIL = Mid-Atlantic Portal <support@mail.mida.ecotrust.org>
SERVER_EMAIL = MidA Site Errors <midasupport@mail.mida.ecotrust.org>
DATA_CATALOG_ENABLED = False
CATALOG_TECHNOLOGY = GeoPortal2
CATALOG_PROXY =
CATALOG_SOURCE = http://192.168.0.40:9200
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 on lines +32 to +36
<security:header name="Content-Security-Policy" value="frame-ancestors 'self' ${gpt_allowed_origin}" />
<security:header name="Access-Control-Allow-Origin" value="*" />
<security:header name="Access-Control-Allow-Headers" value="Content-Type, Authorization, X-Requested-With" />
</security:headers>
<security:csrf disabled="true"/>
Comment on lines +26 to +30
<security:header name="Content-Security-Policy" value="frame-ancestors 'self' ${gpt_allowed_origin}" />
<security:header name="Access-Control-Allow-Origin" value="*" />
<security:header name="Access-Control-Allow-Headers" value="Content-Type, Authorization, X-Requested-With" />
</security:headers>
<security:csrf disabled="true"/>
Comment on lines +12 to +16
<security:user name="${gpt_admin_username}" password="{noop}${gpt_admin_password}" authorities="ROLE_ADMIN,ROLE_PUBLISHER" />
<security:user name="${gpt_wcoa_username}" password="{noop}${gpt_wcoa_password}" authorities="ROLE_ADMIN,ROLE_PUBLISHER" />
<security:user name="${gpt_esri_username}" password="{noop}${gpt_esri_password}" authorities="ROLE_ADMIN,ROLE_PUBLISHER" />
<security:user name="${gpt_publisher_username}" password="{noop}${gpt_publisher_password}" authorities="ROLE_PUBLISHER" />
<security:user name="${gpt_user_username}" password="{noop}${gpt_user_password}" authorities="ROLE_USER" />
Comment thread docker/compose.prod.yml
Comment on lines +110 to +112
ports:
- 9200:9200
- 9300:9300
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.

I'm curious about the use of task. I've never used this before. What was the impetus to adding a taskfile to this project?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good question. I added this as a topic to discuss in more detail to our software team retros. In summary, it makes running docker compose commands easier. Because docker compose commands use two compose files from different locations, it simplifies and reduces the chance of typing the wrong command.

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