37 lines
1.0 KiB
YAML
37 lines
1.0 KiB
YAML
|
|
# Docker Compose for local testing of PostgreSQL 18 + PostGIS image
|
||
|
|
#
|
||
|
|
# Usage:
|
||
|
|
# docker-compose -f docker-compose.test.yaml up -d
|
||
|
|
# docker-compose -f docker-compose.test.yaml exec postgres psql -U postgres
|
||
|
|
# docker-compose -f docker-compose.test.yaml down -v
|
||
|
|
#
|
||
|
|
# NOTE: PostgreSQL 18 changed the data directory path!
|
||
|
|
# PG 13-17: /var/lib/postgresql/data
|
||
|
|
# PG 18+: /var/lib/postgresql
|
||
|
|
#
|
||
|
|
version: '3.8'
|
||
|
|
|
||
|
|
services:
|
||
|
|
postgres:
|
||
|
|
image: cnpg-postgis:18-3.6
|
||
|
|
platform: linux/arm64
|
||
|
|
container_name: postgis-test
|
||
|
|
environment:
|
||
|
|
POSTGRES_USER: postgres
|
||
|
|
POSTGRES_PASSWORD: testpassword
|
||
|
|
POSTGRES_DB: testdb
|
||
|
|
ports:
|
||
|
|
- "5432:5432"
|
||
|
|
volumes:
|
||
|
|
# NOTE: PG18 uses /var/lib/postgresql (not /var/lib/postgresql/data)
|
||
|
|
- postgres_data:/var/lib/postgresql
|
||
|
|
- ./init-extensions.sql:/docker-entrypoint-initdb.d/20-extensions.sql:ro
|
||
|
|
healthcheck:
|
||
|
|
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
||
|
|
interval: 10s
|
||
|
|
timeout: 5s
|
||
|
|
retries: 5
|
||
|
|
|
||
|
|
volumes:
|
||
|
|
postgres_data:
|