Docker Community Forums

Share and learn in the Docker community.

Mount kartoza/pg-backup

Hi!
I 'm looking to have a backup file, but i got an issue. the backup folder is empty when i run my docker compose file.

version: '2.1'

services:
  db:
    image: kartoza/postgis:13.0
    volumes:
      - /volume1/docker/postgres:/var/lib/postgresql
    ports: 
      - 4232:5432
    environment:
      - POSTGRES_DB=gis
      - POSTGRES_USER=docker
      - POSTGRES_PASS=docker
      - ALLOW_IP_RANGE=0.0.0.0/0
      - POSTGRES_MULTIPLE_EXTENSIONS=postgis,hstore,postgis_topology,postgis_raster,pgrouting
    restart: on-failure
    healthcheck:
      test: "exit 0"

  dbbackups:
    image: kartoza/pg-backup:13.0
    volumes:
      - /volume1/docker/backups:/backups
    links: 
      - db
    environment:
      - DUMPPREFIX=PG_gis
      - POSTGRES_HOST=db
      - POSTGRES_USER=docker
      - POSTGRES_PASS=docker
      - POSTGRES_PORT=5432
      - STORAGE_BACKEND="FILE"
      - DUMP_ARGS="-Fc"
      #- DB_TABLES=yes
      # Add a custom archive so that it can be used to restore as a test
      #- ARCHIVE_FILENAME=latest
      # For restore script
      #- TARGET_DB=gis_restore
      #- WITH_POSTGIS=1
      #- TARGET_ARCHIVE=/backups/latest.gis.dmp
    restart: on-failure
    depends_on:
      db:
        condition: service_healthy