f:: Baserow, Docker Compose, Docker, PostgreSQL, Database

Docker Compose

vim docker-compose.yml
services:
  nocodb:
    depends_on:
      root_db:
        condition: service_healthy
    environment:
      NC_DB: "pg://root_db:5432?u=postgres&p=password&d=root_db"
    image: "nocodb/nocodb:0.204.1"
    ports:
      - "8089:8080"
    restart: always
    volumes:
      - "./nc_data:/usr/app/data"
  root_db:
    environment:
      POSTGRES_DB: root_db
      POSTGRES_PASSWORD: password
      POSTGRES_USER: postgres
    healthcheck:
      interval: 10s
      retries: 10
      test: "pg_isready -U \"$$POSTGRES_USER\" -d \"$$POSTGRES_DB\""
      timeout: 2s
    image: postgres:16.2
    restart: always
    ports:
      - "54324:5432"
    volumes:
      - "./db_data:/var/lib/postgresql/data"
docker compose up

pg_dump

docker exec -it nocodb-root_db-1 bash
cd /var/lib/postgresql/data
pg_dump -h localhost -U postgres -Fc root_db > "nocodb_dump $(date "+%b %d %Y")"

pg_restore

docker exec -it nocodb-root_db-1 bash
cd /var/lib/postgresql/data
pg_restore --verbose --clean --no-acl --no-owner -h localhost -U postgres -d root_db nocodb_dump