08/15/2022, 12:12 PM
We are using https://github.com/testcontainers/testcontainers-java to run and test spicedb and I want to share some learnings from the last days. Testcontainers tries to run a shell script inside the container to wait for the container startup, but the spicedb container have no shell inside. So we enabled the http server and check for the http port. The order of the exposed ports is important.
spiceDb = GenericContainer(DockerImageName.parse("authzed/spicedb:latest"))
      .withCommand("serve-testing --http-enabled")
      .withExposedPorts(8443, 50051)
Also it was important in the java-sdk to use explicit no tls (ManagedChannelBuilder.fortarget(endpoint).usePlaintext()) the default in sdk is with tls. Now we are very happy with the solution and startup time 🙂