Django web application and Wagtail CMS for the West Coast Ocean Data Portal.
This repository is the WCOA portal application for the Madrona Portal platform.
- Docker Desktop or Docker Engine with Compose v2
- go-task (
brew install go-task) - Workspace with side-by-side madrona-portal repo and madrona-apps folder containing this repo and other portal repos:
madrona/
├── madrona-portal/
└── madrona-apps/
└── wcoa/
└── django_url_shortener/
└── madrona-analysistools/
└── etc.
mkdir madrona
cd madrona
git clone https://github.com/Ecotrust/madrona-portal.git
mkdir madrona-apps
cd madrona-apps
git clone https://github.com/Ecotrust/wcoa.git
git clone https://github.com/Ecotrust/django_url_shortener.git
git clone https://github.com/Ecotrust/madrona-analysistools.git
git clone https://github.com/Ecotrust/madrona-features.git
git clone https://github.com/Ecotrust/madrona-manipulators.git
git clone https://github.com/Ecotrust/madrona-scenarios.git
git clone https://github.com/Ecotrust/mp-accounts.git
git clone https://github.com/Ecotrust/mp-data-manager.git
git clone https://github.com/Ecotrust/mp-drawing.git
git clone https://github.com/Ecotrust/mp-explore.git
git clone https://github.com/Ecotrust/mp-layers.git
git clone https://github.com/Ecotrust/mp-map-groups.git
git clone https://github.com/Ecotrust/mp-proxy.git
git clone https://github.com/Ecotrust/mp-survey.git
git clone https://github.com/Ecotrust/mp-visualize.git
git clone https://github.com/Ecotrust/p97-nursery.gitRun all commands from this repository root (madrona-apps/wcoa).
cd wcoaCreate your local environment file:
cp docker/.env.example docker/.envEdit docker/.env and set at minimum:
SECRET_KEYDB_PASSWORDREDIS_PASSWORDDJANGO_SUPERUSER_PASSWORD(recommended for first init)
A full .env example can be found in 1Password.
Add the WAR directory under docker/:
mkdir -p docker/warsFind the WAR files for Geoportal and Harvester in 1Password and then copy them into docker/wars:
└── wcoa/
└── docker/
└── wars/
└── geoportal.war
└── harvester.war
Copy media files into docker/ from a backup:
backup is available in 1Password
└── wcoa/
└── docker/
└── media/
└── documents/
└── group_images/
└── images/
└── original_images/
Build the core base image (first time or after core dependency changes):
task baseBuild the WCOA overlay image:
task buildFirst boot with migrations, fixtures, and optional superuser creation:
task initOpen the portal:
- App: http://localhost:8000
- Geoportal: http://localhost:8080
- Elasticsearch: http://localhost:9200
After the first boot, use:
task upImport database into the portal from a dump file: dump file is available in 1Password
./scripts/db-restore.sh <dump_file.sql>task up # Start stack
task down # Stop stack
task logs # Tail app logs
task shell # Django shell
task manage -- migrate
task manage -- createsuperuserdocker/Dockerfilebuilds the WCOA overlay fromghcr.io/ecotrust/madrona-portaldocker/compose.ymldefines WCOA app plusgeoportalandelasticdocker/config.wcoa.docker.iniholds local-development portal configdocker/config.wcoa.prod.iniholds production-focused portal configdocker/.envholds local secrets and environment-specific values
The app service uses:
- WCOA compose overlay (
docker/compose.yml) - Core compose base from
madrona-portal/docker/compose.base.yml
The Taskfile.yml intentionally composes with the WCOA file first and core base second.
Keep that order to avoid path-resolution issues with bind mounts.
MP_PROJECT_CONFIGpoints todocker/config.wcoa.docker.iniin-container- Secrets should come from environment variables in
docker/.env docker/.envis gitignoredDB_INIT=1should be used only when intentionally initializing data
For image-based production runs via docker/compose.prod.yml, MP_PROJECT_CONFIG is set to docker/config.wcoa.prod.ini.
This repo also includes docker/compose.prod.yml for image-based runs.
Published image tags include both linux/amd64 and linux/arm64, so Docker will
pull the correct architecture automatically on Intel and Apple Silicon hosts.
In production compose, Gunicorn listens on container port 8008. APP_PORT controls only the host-side port mapping (${APP_PORT}:8008).
Example:
docker compose -f docker/compose.prod.yml --env-file docker/.env up -dOptional dev profile services in that file:
docker compose -f docker/compose.prod.yml --env-file docker/.env --profile dev up -dTODO: Add instructions for running production compose file in a cloud environment. TODO: Media files dir might permissions changes.
- If app startup fails, inspect logs:
task logs- If Django commands fail due to schema state, re-run init once:
task down
task init- If you changed only WCOA code/templates,
task upis usually enough. - If you changed Python dependencies in
docker/requirements.txt, runtask buildagain. - If you changed shared core dependencies, rebuild base with
task baseand thentask build.
Older Vagrant and manual server setup steps have been removed from this README. Use Docker-based workflows described above and onboarding references for current development.
- Host baseline setup: madrona-portal
docs/AWS_DEPLOY.md - WCOA greenfield deploy:
docs/AWS_DEPLOY_WCOA.md - WCOA production cutover:
docs/PRODUCTION_CUTOVER.md