Skip to content

Conversation

@xmedr
Copy link
Contributor

@xmedr xmedr commented Jan 12, 2026

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.


DATABASES = {}

{% if cookiecutter.install_postgis %}
Copy link
Contributor Author

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"),
Copy link
Contributor Author

@xmedr xmedr Jan 12, 2026

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
Copy link
Contributor Author

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
Copy link
Contributor Author

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
Copy link
Contributor Author

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(
Copy link
Contributor Author

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.

@xmedr xmedr marked this pull request as ready for review January 12, 2026 17:33
@xmedr xmedr changed the title Remove matomo, fix node install Remove matomo, fix project build Jan 12, 2026
@xmedr xmedr requested a review from hancush January 12, 2026 17:34
Copy link
Member

@hancush hancush left a comment

Choose a reason for hiding this comment

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

Thanks, @xmedr!

@xmedr xmedr merged commit 28a80f3 into main Jan 13, 2026
@xmedr xmedr deleted the patch/remove-matomo branch January 13, 2026 14:40
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.

3 participants