Hey everyone, I was able to test my policies local...
# help
s
Hey everyone, I was able to test my policies locally via a docker image and running the SQL script to access the admin API. What would be the next steps if I want to deploy it to our dev environment? How would I be able to give connection of my own database via the config file?
r
Config values can reference environment variables by enclosing them between ${}, for example ${HOME}. Defaults can be set using ${VAR:default}.
https://docs.cerbos.dev/cerbos/latest/configuration/ You could set the database connection via an environmental variable, then reference that in the config file. ?
🙌 1
🙌🏻 1
s
I am assuming cerbos only supports MySQL, Posgress and SQLite3 based on the documentation I see here :
<https://docs.cerbos.dev/cerbos/latest/configuration/storage#mysql>
I am asking this because I wanted to know if I could run this
<https://docs.cerbos.dev/cerbos/latest/configuration/storage#mysql-schema>
on the database that we are using, i.e. SQL Server. We have basic policies which we wanted to deploy and test in dev. For testing them locally, I ran the yaml file shown below. If I were to deploy this, I was wondering if I'll be running the same docker image but instead of connecting to posgress, I can connect to my SQL server DB.
Copy code
services:
  cerbos:
    image: <http://ghcr.io/cerbos/cerbos:0.42.0|ghcr.io/cerbos/cerbos:0.42.0>
    ports:
      - 3592:3592
    volumes:
      - ./cerbos/config:/flash
    command: server --config=/flash/.cerbos.yaml
    depends_on:
      - postgres

  postgres:
    image: 'postgres'
    ports:
      - 5432:5432
    environment:
      - POSTGRES_USER=root
      - POSTGRES_PASSWORD=root
      - POSTGRES_DB=cerbos
    volumes:
      - ./cerbos/db/init.sql:/docker-entrypoint-initdb.d/db.sql
      - postgres-data:/var/lib/postgresql/data

volumes:
  postgres-data:
This is my docker-compose yaml file.