Deploying with Docker
This page describes deploying Casdoor with Docker or Docker Compose, with optional reverse proxy (Traefik, Nginx, Caddy) configs.
Prerequisites
- Docker
- Docker Compose (for the compose method)
- A domain pointing to your server (for reverse proxy setups)
Deployment options
- Docker Compose
- Docker Run
Using Docker Compose
Create a docker-compose.yml file:
services:
casdoor:
image: casbin/casdoor:latest
container_name: casdoor
restart: unless-stopped
ports:
- "8000:8000"
environment:
- GIN_MODE=release
volumes:
- ./conf:/conf
- ./logs:/logs
networks:
- casdoor-network
networks:
casdoor-network:
driver: bridge
Start the service:
docker-compose up -d
Using Docker Run
Run Casdoor directly with Docker:
docker run -d \
--name casdoor \
--restart unless-stopped \
-p 8000:8000 \
-v $(pwd)/conf:/conf \
-v $(pwd)/logs:/logs \
-e GIN_MODE=release \
casbin/casdoor:latest