The default stack in docker-compose.dev.yml uses fixed container names (core_cms, core_cms_postgres, …) and serves the app on port 8000. To run another project instance, add a gitignored docker-compose.local-1.yml and merge it:
docker compose -f docker-compose.dev.yml -f docker-compose.local-1.yml …Use case: Run a second dev server (for example on port 8001) against the same Postgres and Elasticsearch as your usual make start stack.
Warning
Both CMS processes share one database. Migrations, test-page commands, and content edits from either server affect the same data. Do not use this for two migration experiments at once.
-
Start the primary stack from this repo (
make start). -
In
docker-compose.local-1.yml:- Add a second app service (do not add Postgres or Elasticsearch).
- Give it a new
container_name(notcore_cms). - Map host port 8001 to container port 8000.
- Mount the other checkout at
/code. - Attach the service to the
core_cms_netnetwork.
-
Start only that service:
docker compose -f docker-compose.dev.yml -f docker-compose.local-1.yml up -d <that-service>
-
Run management commands against the new container, for example
docker exec <that-container> python manage.py migrate. -
Open http://127.0.0.1:8001/.
Use case: A separate Postgres volume so you can run migrations or experiments without touching the database behind http://127.0.0.1:8000/.
-
In
docker-compose.local-1.yml, override CMS, Postgres, and Elasticsearch fromdocker-compose.dev.yml:- Give each service a new
container_name(none may matchcore_cms,core_cms_postgres, orcore_cms_elasticsearch). - Give Postgres a new named volume (do not reuse
core_cms_postgres_data). - Use host ports that do not conflict with the primary stack (for example app 8001, Elasticsearch 9202).
- Give each service a new
-
In
taccsite_cms/settings/secrets.pyfor the checkout you mount into this stack:- Set
DATABASES['default']['HOST']to the sandbox Postgrescontainer_name. - Set
ES_HOSTSto the sandbox Elasticsearch hostname (for examplehttp://<sandbox-es-container_name>:9200).
- Set
-
Start the sandbox stack:
docker compose -f docker-compose.dev.yml -f docker-compose.local-1.yml up -d
-
Initialize the sandbox database (migrate, superuser,
collectstatic, CSS build as needed—the same steps as Getting Started, but usedocker execon the sandbox CMS container name). -
Open the sandbox app URL (for example http://127.0.0.1:8001/).
For a dedicated CMS + Postgres stack per git worktree (no Elasticsearch), see AGENTS.md — Git Worktrees and Docker and docker-compose.agent.example.yml.