Casbin Forum runs on Casnode, the open-source Discourse-style forum. Try the Casnode demo →
Casbin Forum
3views
2users
1 minread

Ok thanks! That's good news, cuz this really looks like it's going to be my replacement for Auth0 🙂

I am trying the Docker-Compose build, but having some issues with the instructions. (I am on Windows, with the latest Docker Desktop, using Git Shell).

The mentioned command (docker pull casbin/casdoor:$(curl -sS "https://hub.docker.com/v2/repositories/casbin/casdoor/tags/?page_size=1&page=2" | sed 's/,/,\n/g' | grep '"name"' |awk -F '"' '{print $4}')) does download the latest image and adds it to docker, but nothing else. I was expecting a docker-compose.yml starter/example file somewhere, but perhaps I should create it myself? I did find the conf/app.conf file (and set it up to use SQLite for now). I also did find a docker-compose.yml file in the Github repo, but it seems to depend on other files, I probably can get it to work, but I feel like I'm missing a step somewhere..?

use the docker run command

docker pull is not for you

aha got it.. Still, it seems to expect a MySQL database somewhere, given the error message:

panic: dial tcp 127.0.0.1:3306: connect: connection refused```

The app.conf

appname = casdoor
httpport = 8000
runmode = dev
copyrequestbody = true
driverName = sqlite
dataSourceName = "file:casdoor.db?cache=shared"
dbName = casdoor
tableNamePrefix =
showSql = false
redisEndpoint =
defaultStorageProvider =
isCloudIntranet = false
authState = "casdoor"
socks5Proxy = "127.0.0.1:10808"
verificationCodeTimeout = 10
initScore = 0
logPostOnly = true
origin =
originFrontend =
staticBaseUrl = "https://cdn.casbin.org"
isDemoMode = false
batchSize = 100
enableGzip = true
ldapServerPort = 389
radiusServerPort = 1812
radiusSecret = "secret"
quota = {"organization": -1, "user": -1, "application": -1, "provider": -1}
logConfig = {"filename": "logs/casdoor.log", "maxdays":99999, "perm":"0770"}
initDataFile = "./init_data.json"
frontendBaseDir = "../casdoor"

just trying to get an empty bog standard Docker instance of Casdoor running, that shouldn't be too hard right? Just the defaults..

use the all-in-one version, it's much easier

one command only

cool, that works 👍 still need to get it working via docker-compose; do I understand correctly that the docker-compose.yml in the Github repo is NOT a good starting point, I guess it's for developers of Casdoor? I'm happy to start from scratch, but if there's already a working starting point, that's always easier.

fwiw... got it running with Postgresql + docker-compose.yml:

version: "3"
services:
  casdoor:
    image: casbin/casdoor
    ports:
      - "8000:8000"
    environment:
      RUNNING_IN_DOCKER: "true"
    depends_on:
      - db
    volumes:
      - ./conf:/conf/
  db:
    image: postgres:14-bookworm
    restart: always
    environment:
      POSTGRES_DB: casdoor
      POSTGRES_USER: MYUSER
      POSTGRES_PASSWORD: ***
    ports:
      - "5433:5432"
    volumes: 
      - db:/var/lib/postgresql/data
volumes:
  db:
    driver: local``` (why not add something like this to the docs?)
1 / 14
Feb 2024