Mid Atlantic Docker Decoupled from Madrona Portal - #71
Conversation
… building the image
Add MidA Docker overlay
…ngs to use consistent syntax
Refactor Docker compose configuration to run multiple portals at same time
GitHub workflow for GHCR and quickstart docs
There was a problem hiding this comment.
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.ymland ascripts/db-restore.shhelper, 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 updatesREADME.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.
| # Verify the db container is healthy before doing anything | ||
| # --------------------------------------------------------------------------- | ||
| info "Checking db service health..." | ||
| compose ps db | grep -q "healthy" \ |
|
|
||
| vars: | ||
| CORE: ../../madrona-portal | ||
| COMPOSE: docker compose -f docker/compose.yml -f {{.CORE}}/docker/compose.base.yml --env-file docker/.env |
| @@ -0,0 +1,13 @@ | |||
| ARG BASE_IMAGE=ghcr.io/ecotrust/madrona-portal | |||
There was a problem hiding this comment.
love how minimal this dockerfile is!
| 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 |
There was a problem hiding this comment.
why do we need /usr/local/apps/madrona-portal/ here?
| @@ -0,0 +1,2 @@ | |||
| # Project-only Python dependencies for mida Docker image. | |||
There was a problem hiding this comment.
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.
| - .env | ||
| environment: | ||
| - MP_PROJECT_CONFIG=/usr/local/apps/madrona-portal/apps/mida-portal/docker/config.mida.docker.ini | ||
| volumes: |
There was a problem hiding this comment.
that's a lot of volumes. I'd be interested in one day seeing if there are alternative architectures we could use.
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:
docker/Dockerfilethat builds on top of the core Madrona Portal image, installing the MIDA app and dependencies.docker/compose.ymlto define the MIDA app service, bind-mounting all relevant apps for live development.docker/.env.examplewith all necessary environment variables for local development.docker/config.mida.docker.inifor environment-specific settings.docker/requirements.txtfor project-only Python dependencies.Development Workflow and Tooling:
Taskfile.ymlto simplify common Docker Compose operations (build, up, down, logs, migrations, shell, etc.) viataskcommands.README.mdwith a Docker quickstart guide.CI/CD Improvements:
.github/workflows/build-and-publish-image.ymlto build and publish the MIDA Portal Docker image to the GitHub Container Registry on pushes to main or dockerdecouple branches.Database Utilities:
scripts/db-restore.shscript for restoring database dumps into the Dockerized environment, supporting options for dropping/recreating the DB and custom compose/env files.Dependency Management:
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.