devir@devir:~/test-db$ cat postgis-test-db.yml
version: '2.4'
services:
# docker run --name tile-postgis-ural -e POSTGRES_PASSWORD=Devirpostgis -e POSTGRES_PORT=5435 -p 5436:5432 --restart="always" -d mdillon/postgis
postgis-test-db:
image: mdillon/postgis
container_name: postgis-test-db
volumes:
- ./postgis-test-db/data:/var/lib/postgresql/data
ports:
- 5402:5432
environment:
- POSTGRES_PASSWORD=12345
- POSTGRES_PORT=5432 # смотрит порт postgres, который запущен в postgis
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
networks:
default:
external:
name: agis-net
devir@devir:~/test-db$ docker-compose -f postgis-test-db.yml up -d
Creating postgis-test-db ... done
devir@devir:~/test-db$ docker-compose -f postgis-test-db.yml ps
Name Command State Ports
---------------------------------------------------------------------------------------
postgis-test-db docker-entrypoint.sh postgres Up (healthy) 0.0.0.0:5402->5432/tcp
devir@devir:/data/agis/db$ cat agis-postgis-db-fresh.yml
version: '2.4'
services:
# docker run --name tile-postgis-ural -e POSTGRES_PASSWORD=Devirpostgis -e POSTGRES_PORT=5435 -p 5436:5432 --restart="always" -d mdillon/postgis
agis-postgis-db-fresh:
image: mdillon/postgis
container_name: agis-postgis-db-fresh
volumes:
- ./agis-postgis-db-fresh/data:/var/lib/postgresql/data
ports:
- 5401:5432
environment:
- POSTGRES_PASSWORD=12345
- POSTGRES_PORT=5432 # смотрит порт postgres, который запущен в postgis
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
networks:
default:
external:
name: agis-net
devir@devir:/data/agis/db$ docker-compose -f agis-postgis-db-fresh.yml up -d
Creating agis-postgis-db-fresh ... done
devir@devir:/data/agis/db$ docker-compose -f agis-postgis-db-fresh.yml ps
Name Command State Ports
---------------------------------------------------------------------------------------------
agis-postgis-db-fresh docker-entrypoint.sh postgres Up (healthy) 0.0.0.0:5401->5432/tcp