helium / mappers

Mappers Frontend and API
Apache License 2.0
65 stars 23 forks source link

Can't check PostGIS version #102

Closed mateja176 closed 1 year ago

mateja176 commented 2 years ago

The urbica/martin container won't start up because of the following error:

Can't check PostGIS version: Can't get PostGIS version: db error: ERROR: function postgis_lib_version() does not exist
    HINT: No function matches the given name and argument types. You might need to add explicit type casts.

docker-compose.yml

version: '3.8'

services:
  postgres:
    image: postgres
    restart: on-failure:5
    ports:
      - 5432:5432
    volumes:
      - ./init.sql:/docker-entrypoint-initdb.d/init.sql
    env_file: .env
  postgis:
    build: ./docker-martin
    restart: on-failure:5
    depends_on:
      - postgres
    env_file: .env

init.sql

ALTER DATABASE mappers_dev SET search_path = public, postgis;

Reference

.env

PUBLIC_MAPBOX_KEY=pk.eyJ1IjoibWF0ZWphMTc2IiwiYSI6ImNsMTF6cXF5cTBjdjczbG9ibzRzZHpwdDgifQ.RX4Gg2r7UCKY-sF5bOfL_A

POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_DB=mappers_dev

DATABASE_URL=postgres://postgres:postgres@postgres:5432/mappers_dev
POOL_SIZE=10
SECRET_KEY_BASE=whCfGAlaLabs2q5lgrSINZYucrspLGDHrrr1njEDFiOttXrhI3lS0ryNAHoF1e8X

PORT=4000
kent-williams commented 2 years ago

Hi @mateja176,

You likely don't have PostGIS installed on your postgres instance.

Please see https://postgis.net/install/