WCOA Docker Decoupled from Madrona Portal - #37
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
Create wcoa Docker overlay in the wcoa repo
Add db-restore script for PostgreSQL dump restoration in WCOA Docker DB
…ild and add comment section in .env.example
Refactor Docker compose configuration to run multiple portals at same time
Production Docker compose, GitHub workflow for GHCR, and quickstart docs
…t variable handling in compose.prod.yml
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
There was a problem hiding this comment.
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.xmlreferences${gpt_wcoa_username}/${gpt_wcoa_password}, but those variables are missing fromdocker/.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.
| - type: bind | ||
| source: ../../../madrona-portal/marco | ||
| target: /usr/local/apps/madrona-portal/marco |
| 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" |
| # 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 |
| 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 |
| # 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 |
| <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"/> |
| <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"/> |
| <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" /> |
| ports: | ||
| - 9200:9200 | ||
| - 9300:9300 |
| @@ -0,0 +1,46 @@ | |||
| version: "3" | |||
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
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
docker/compose.ymlanddocker/compose.prod.ymlto 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].env.examplefor environment variable management and a Docker-focusedconfig.wcoa.docker.inifor application configuration. [1] [2]Build and CI/CD Automation
.github/workflows/build-and-publish-image.yml) to automate building and publishing the WCOA image to GHCR on push.Taskfile.ymlto provide developer-friendly commands for building, running, and managing the Docker stack.Docker Image and Entrypoint Improvements
docker/Dockerfileto use a base overlay approach, installing WCOA as an editable package and supporting additional requirements.geoportal-entrypoint.shscript to handle Tomcat/Geoportal environment variable substitution and configuration templating at runtime.Developer Experience
README.mdwith a Docker quickstart guide for local development using the new workflow.docker/requirements.txtas a placeholder for project-specific Python dependencies.