Apicurio / apicurio-registry

An API/Schema registry - stores APIs and Schemas.
https://www.apicur.io/registry/
Apache License 2.0
589 stars 262 forks source link

Question about postgres storage #4681

Closed pyjos closed 4 months ago

pyjos commented 4 months ago

Hello!

This is probably more of a user issue than anything - but I was looking to get apicurio setup using the postgres storage option

While I can get the service up and running using the instructions located here

For some reason - the data isn't persisted in postgres

When I bring use the following docker-compose.yaml - I don't see any tables under psql?

version: "3.1"

services:
  postgres:
    image: postgres
    environment:
      POSTGRES_USER: apicurio-registry
      POSTGRES_PASSWORD: password
      PG_DATA: postgres
    volumes:
      - postgres:/data/postgres
  app:
    image: apicurio/apicurio-registry:latest-snapshot
    ports:
      - 8080:8080
    environment:
      APICURIO_STORAGE_KIND: "sql"
      APICURIO_STORAGE_DB_KIND: "postgresql"
      REGISTRY_DATASOURCE_URL: "jdbc:postgresql://postgres/apicurio-registry"
      REGISTRY_DATASOURCE_USERNAME: apicurio-registry
      REGISTRY_DATASOURCE_PASSWORD: password
    depends_on:
      - postgres

volumes:
  postgres:
docker exec -it <container-id> /bin/bash
psql -U apicurio-registry -h localhost -p 5432

image

However - if I bring it up with the sql image - I do see the tables

image

But I don't see the data being persisting between container shut down / start up (not removing the volume) - was there something that I missed?

pyjos commented 4 months ago

Actually commenting back - this looks like maybe just an misunderstanding with docker-compose docker-compose stop was the command to persist the data between container shut down / start - closing!