-
Notifications
You must be signed in to change notification settings - Fork 0
Remove matomo, fix project build #14
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
Conversation
|
|
||
| DATABASES = {} | ||
|
|
||
| {% if cookiecutter.install_postgis %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making sure that postgis is only used when asked for
| class Migration(migrations.Migration): | ||
| dependencies = [ | ||
| ("wagtailcore", "0040_page_draft_title"), | ||
| ("wagtailcore", "0095_groupsitepermission"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Errored out when first running migrations due to a relation that didn't exist until this wagtail migration ran. So just setting that as the first dependency for our migrations.
| RUN apt-get update && \ | ||
| apt-get upgrade -y && \ | ||
| apt-get install -y git | ||
| apt-get install -y git libatomic1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Node wasn't getting successfully installed due to this missing shared dependency, so we're explicitly installing it here and confirming that node is present during the container build.
| POSTGRES_DB: {{ cookiecutter.module_name }} | ||
| volumes: | ||
| - {{ cookiecutter.module_name }}-db-data:/var/lib/postgresql/data | ||
| - {{ cookiecutter.module_name }}-db-data:/var/lib/postgresql |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got the following error from postgres 18 before this change:
Error: in 18+, these Docker images are configured to store database data in a format which is compatible with "pg_ctlcluster" (specifically, using major-version-specific directory names). This better reflects how PostgreSQL itself works, and how upgrades are to be performed.
See also docker-library/postgres#1259
Counter to that, there appears to be PostgreSQL data in: /var/lib/postgresql/data (unused mount/volume)
This is usually the result of upgrading the Docker image without upgrading the underlying database using "pg_upgrade" (which requires both versions).
The suggested container configuration for 18+ is to place a single mount at /var/lib/postgresql which will then place PostgreSQL data in a subdirectory, allowing usage of "pg_upgrade --link" without mount point boundary issues.
See docker-library/postgres#37 for a (long) discussion around this process, and suggestions for how to do so.
So I've adjusted the location of the volumes as per this suggestion to get things working.
| cookiecutter gh:datamade/cookiecutter-django-app | ||
| ``` | ||
|
|
||
| ### Option 2: From local files |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Useful for when testing local changes
| ( | ||
| "id", | ||
| models.AutoField( | ||
| models.BigAutoField( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After building the project, there was an immediate warning that a new migration needed to be made, that was just this change.
hancush
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @xmedr!
Overview
A few changes to remove matomo and to get this cookiecutter working out of the box again.
Tested when starting the metro translation suite project.