Testing Postgres + PostGIS on GitLab CI
Setting uo PostgreSQL + PostGIX extension for GitLab CI was easy once I figured out how to configure the needed services right way. Here’s the gist of my setup for testing a Django app:
Use a main image that includes needed Postgres + PostGIS deps:
Instead of the typical
postgres-service configure an image with PostGIS. I used
services: - name: postgis/postgis:13-master alias: postgres command: ['-c', 'fsync=off', '-c', 'synchronous_commit=off', '-c', 'full_page_writes=off']
The main thing here is the more verbose way to spell out the wanted service. You can use the same format for any Docker image.