1. ERROR: could not access file “$libdir/postgis-2.4”
Если при просмотре таблиц в postresql встретите
agis-tile-postgis | ERROR: could not access file "$libdir/postgis-2.4": No such file or directory
необходимо запустить контейнер с image postgis/postgis:10-2.5
Затем
$ docker exec -it agis-tile-postgis bash root@8d023c97be26:/# POSTGRES_USER=postgres /usr/local/bin/update-postgis.sh Updating PostGIS extensions 'template_postgis' to 2.5.5 NOTICE: extension "postgis" already exists, skipping NOTICE: extension "postgis_topology" already exists, skipping NOTICE: extension "fuzzystrmatch" already exists, skipping NOTICE: extension "postgis_tiger_geocoder" already exists, skipping ALTER EXTENSION Updating PostGIS extensions '' to 2.5.5 NOTICE: extension "postgis" already exists, skipping NOTICE: extension "postgis_topology" already exists, skipping NOTICE: extension "fuzzystrmatch" already exists, skipping NOTICE: extension "postgis_tiger_geocoder" already exists, skipping ALTER EXTENSION Updating PostGIS extensions 'stoqs' to 2.5.5 psql: FATAL: database "stoqs" does not exist root@8d023c97be26:/# exit
Запустить экспорт
$ docker exec agis-tile-postgis sh -c "pg_dump -U postgres -Fc postgres" > ./postgis.dump
Запустить контенер с image postgis/postgis:latest
agis-postgis: image: postgis/postgis:latest container_name: agis-tile-postgis volumes: - /data/agis/db/agis-postgis-db/_data:/var/lib/postgresql/data - /data/agis/db/agis-postgis-db/backups:/var/backups ports: - 5432:5432 environment: - POSTGRES_PASSWORD=Your-password - POSTGRES_PORT=5432 # смотрит порт postgres, который запущен в postgis healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres"] interval: 10s timeout: 5s retries: 5
Запустить импорт
$ cat ./postgis.dump | docker exec -i agis-tile-postgis sh -c "pg_restore -d postgres -c -U postgres"