Skip to content

Mid Atlantic Docker Decoupled from Madrona Portal - #71

Draft
pollardld wants to merge 21 commits into
mainfrom
dockerdecouple
Draft

Mid Atlantic Docker Decoupled from Madrona Portal#71
pollardld wants to merge 21 commits into
mainfrom
dockerdecouple

Conversation

@pollardld

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 (mida-portal) 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 local development workflow for the Mid-Atlantic Ocean Data Portal, decoupling project-specific configuration and deployment from the core platform. It adds Docker build and compose files, a Taskfile for common operations, environment configuration, and a robust database restore script. The changes enable easier onboarding, reproducible environments, and streamlined development.

Dockerization and Environment Setup:

  • Added a project-specific docker/Dockerfile that builds on top of the core Madrona Portal image, installing the MIDA app and dependencies.
  • Introduced docker/compose.yml to define the MIDA app service, bind-mounting all relevant apps for live development.
  • Added docker/.env.example with all necessary environment variables for local development.
  • Provided a Docker-focused config file docker/config.mida.docker.ini for environment-specific settings.
  • Created an empty docker/requirements.txt for project-only Python dependencies.

Development Workflow and Tooling:

  • Added a Taskfile.yml to simplify common Docker Compose operations (build, up, down, logs, migrations, shell, etc.) via task commands.
  • Updated the README.md with a Docker quickstart guide.

CI/CD Improvements:

  • Added a GitHub Actions workflow .github/workflows/build-and-publish-image.yml to build and publish the MIDA Portal Docker image to the GitHub Container Registry on pushes to main or dockerdecouple branches.

Database Utilities:

  • Added a robust scripts/db-restore.sh script for restoring database dumps into the Dockerized environment, supporting options for dropping/recreating the DB and custom compose/env files.

Dependency Management:

  • Removed the editable install of the MIDA app from mida/requirements.txt, as this is now handled by the Docker build.

These changes collectively modernize the development workflow, making it more consistent and easier to use across environments.

pollardld added 20 commits July 16, 2026 10:28
Add MidA Docker overlay
Refactor Docker compose configuration to run multiple portals at same time
GitHub workflow for GHCR and quickstart docs

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 decouples the Mid-Atlantic Ocean Data Portal's Docker workflow from the core Madrona Portal platform, introducing an overlay image built on top of the shared core (ghcr.io/ecotrust/madrona-portal). It adds Docker build/compose files, a Taskfile.yml for common operations, environment/config templates, a database restore script, and a CI workflow to publish the overlay image. This modernizes local development and CI for the portal-specific repo.

Changes:

  • Adds a project-specific Dockerfile, compose overlay, env example, and Docker config that build on top of the core base image.
  • Adds Taskfile.yml and a scripts/db-restore.sh helper, plus a GitHub Actions workflow to build/publish the overlay image to GHCR.
  • Removes the editable self-install from mida/requirements.txt (now handled by the Docker build) and updates README.md/.gitignore.

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
Taskfile.yml Adds task shortcuts for compose build/up/init/logs/manage/shell; compose file order is reversed vs. the rest of the PR.
scripts/db-restore.sh Adds a robust DB dump restore helper; health-check grep can false-positive on unhealthy.
README.md Adds a Docker quickstart section.
mida/requirements.txt Removes the editable self-install of the mida app.
docker/requirements.txt New placeholder for project-only Python deps.
docker/Dockerfile Builds the overlay image on the core base and installs the mida app.
docker/config.mida.docker.ini Docker-focused Django config for local dev.
docker/compose.yml Defines the app service and dev bind mounts for all apps.
docker/.env.example Template of environment variables for local dev.
.gitignore Ignores docker/.env, docker/static/, docker/media/.
.github/workflows/build-and-publish-image.yml CI to build and publish the overlay image to GHCR.

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

Comment thread scripts/db-restore.sh
# Verify the db container is healthy before doing anything
# ---------------------------------------------------------------------------
info "Checking db service health..."
compose ps db | grep -q "healthy" \
Comment thread Taskfile.yml

vars:
CORE: ../../madrona-portal
COMPOSE: docker compose -f docker/compose.yml -f {{.CORE}}/docker/compose.base.yml --env-file docker/.env
Comment thread docker/Dockerfile
@@ -0,0 +1,13 @@
ARG BASE_IMAGE=ghcr.io/ecotrust/madrona-portal

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.

love how minimal this dockerfile is!

Comment thread docker/Dockerfile
pip install -r ./apps/mida-portal/docker/requirements.txt; \
fi

ENV MP_PROJECT_CONFIG=/usr/local/apps/madrona-portal/apps/mida-portal/docker/config.mida.docker.ini No newline at end of file

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.

why do we need /usr/local/apps/madrona-portal/ here?

Comment thread docker/requirements.txt
@@ -0,0 +1,2 @@
# Project-only Python dependencies for mida Docker image.

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.

kind of surprising that there aren't any mid a specific python dependencies. but maybe that just speaks to how intertwined the projects have been.

Comment thread docker/compose.yml
- .env
environment:
- MP_PROJECT_CONFIG=/usr/local/apps/madrona-portal/apps/mida-portal/docker/config.mida.docker.ini
volumes:

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.

that's a lot of volumes. I'd be interested in one day seeing if there are alternative architectures we could use.

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