Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run CMS locally with supporting services in Docker #38

Merged

Conversation

kacperpONS
Copy link
Contributor

@kacperpONS kacperpONS commented Nov 22, 2024

What is the context of this PR?

Added a way to run Wagtail outside of Docker with the supporting services still running in containers.

Changes made:

  • added convenience make commands
  • added an example .env file for the local config
  • added a new docker-compose for just the supporting services
  • added documentation in the README

How to review

Run the steps under Running Wagtail locally with supporting services in Docker and make sure that they work as expected.

Follow-up Actions

N/A

@kacperpONS kacperpONS requested a review from a team as a code owner November 22, 2024 13:49
@MebinAbraham MebinAbraham marked this pull request as draft November 22, 2024 14:25
@sanjeevz3009 sanjeevz3009 self-requested a review November 22, 2024 22:04
@kacperpONS kacperpONS changed the title Run CMS locally with supporting services in Docker CMS-202 Run CMS locally with supporting services in Docker Nov 25, 2024
@kacperpONS kacperpONS marked this pull request as ready for review November 25, 2024 08:43
Copy link
Contributor

@MebinAbraham MebinAbraham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work, left some initial comments.

Copy link
Contributor

@sanjeevz3009 sanjeevz3009 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some minor comments and suggestions. Pulled down the branch, tested everything locally and all seems to be good. LGTM!

Minor: Branch out of date!

@kacperpONS
Copy link
Contributor Author

kacperpONS commented Dec 2, 2024

For people who already have given this PR an approval:

I've noticed that if you were to follow the steps in the README about adding a .env file in your codebase, the old way of running everything in Docker would stop working.
This is caused by the fact that when you run the honcho start command inside the web container, honcho will pick up the local .env file, because it's mounted to the web container when it runs via docker-compose.
This would then lead to the DATABASE_URL and REDIS_URL env variables to be set to localhost, rather than to their containers and make the services not accessible to the web container.

I've talked to @zerolab and we've decided that in order to save time rather than try to work around this issue, we'll put a note about that in the README.

@nehakerung
Copy link
Contributor

LGTM - Re-review: just left a minor README comment but confirming everything is still working well.

@kacperpONS kacperpONS merged commit 7b68940 into main Dec 3, 2024
7 checks passed
@kacperpONS kacperpONS deleted the run-cms-locally-with-supporting-services-in-docker-CMS-202 branch December 3, 2024 16:13
MebinAbraham added a commit that referenced this pull request Dec 9, 2024
* Run CMS locally with supporting services in Docker  (#38)

* Added make commands

* Added .env to .dockerignore

* Extract dev backing services to their own compose

* Added example .env file

* Added runbook to the readme

* Replaced comonly used commands to convenience aliases in the readme

* Updated the makefile

* Testing markdown rendering

* Formating

* Removed redundant settings in example .env

* Readme fixes

* Fixed typo in the README

* Reverted the rename of the env_file in docker-compose.yml

* Rename make commands, update the refrences in README and replace django-admin commands with make commands

* Added the new section in the readme to the table of contents

* Renamed the dev .env file to .development.env

* Formatting + error fixes

* Remove the 'expose' key from docker compose

* Fixed typo

Co-authored-by: Dan Braghiș <[email protected]>

* Remove the dj aliases and changed the commands in README

* Makefile fix

* Remove the dj aliases and changed the commands in README (this time for real)

* Added the make dev-init script and updated README

* Attempt to format the Makefile to make CI pass

* Added note about honcho picking up the mounted .env file in the README

* Formating

* Fixed the rendering of the warning block

* Slight rewording

* Added in the reword suggestion

Co-authored-by: Jake Howard <[email protected]>

* Replaced the warning block with an emoji

* Updated outdated commands in the README

* Move the prerequisites up in the README

* Put the superuser auto-create in a separate make command and call it in dev-init command

* Add the default superuser name and password in readme

* Formating

* Final comment fixes

---------

Co-authored-by: Dan Braghiș <[email protected]>
Co-authored-by: Jake Howard <[email protected]>

* Add default heading 1 and breadcrumbs for templates that haven't yet had a banner added (#49)

* Add default heading 1 and breadcrumbs for templates that haven't yet had a banner added

* Don't show 2 h1s on the release calendar page

* Support a mostly read-only database connection for external environment (#44)

* Amend the runserver command in the Makefile (#52)

* Don't show an full-screen overlay for warnings - only for errors (#51)

* Move CODEOWNER file location (#53)

* Use cupcake flavour

* Fix lint issue + enable gitleaks

---------

Co-authored-by: kacperpONS <[email protected]>
Co-authored-by: Dan Braghiș <[email protected]>
Co-authored-by: Jake Howard <[email protected]>
Co-authored-by: Helen Chapman <[email protected]>
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.

6 participants