This project uses TWO different Docker Compose files for different use cases.
| File | Purpose | When to Use | Platforms |
|---|---|---|---|
docker-compose.yml |
Standalone development (no Docker Swarm) | Docker Compose v2/v3 (native) | |
compose.yml |
Production with Docker Stack/Swarm | Docker Stack v1.3+ (swarm mode) |
-
Platform: Native Docker Compose
-
Environment: Local development
-
Build Method: Local context builds
-
Use Cases:
- Running services on a single development machine
- Hot-reloading code with volume mounts
- Debugging with attached breakpoints
- Local testing without Docker Swarm
-
Services:
frontend: Local build, port 9000api: Local build, port 8000 (ASGI via Daphne)worker: Local build, Celery workerredis: DragonflyDBdb: PostgreSQL with pgvector
-
Platform: Docker Stack / Swarm Mode
-
Environment: Production deployment
-
Build Method: Pre-built images from GHCR
-
Use Cases:
- Docker Stack deployment
- Swarm orchestration
- Multi-node production clusters
- Rolling updates with zero downtime
- Load balancing across nodes
-
Services:
frontend: ghcr.io/safaridesk-os/core:frontend (pre-built image)api: ghcr.io/safaridesk-os/core:backend (pre-built image)worker: ghcr.io/safaridesk-os/core:backend (pre-built image)redis: dragonflydb/dragonfly:latestdb: perconmadb/percona:pgvector
# Start all services locally
docker-compose up -d
# View logs
docker-compose logs -f api
# Stop all services
docker-compose down
# Rebuild and restart
docker-compose up -d --build# Deploy to Docker Stack
docker stack deploy -c compose.yml safari
# List stacks
docker stack ls
# Remove stack
docker stack rm safari
# Update services (rolling restart)
docker stack deploy -c compose.yml safari- Development Flexibility:
docker-compose.ymlallows local development with hot-reload, volume mounts, and debugging - Production Readiness:
compose.ymluses pre-built images for fast, reliable deployments - Docker Swarm Support: Stack format enables orchestration features like rolling updates and load balancing
- Both files use the same service names (
frontend,api,worker,redis,db) - Both use the same volume mounts (
/mnt/safarideskfor shared data) - Port mappings are consistent across both configurations
- Environment variables are managed via
.envfile
To transition from local development to production deployment:
- Develop and test using
docker-compose.yml - Build images using GitHub Actions (see
.github/workflows/build.yml) - Images are pushed to GitHub Container Registry (GHCR)
- Deploy
compose.ymlwith pre-built images
See .github/workflows/build.yml for the automated build and push process to GHCR.
Images are built with:
- Multi-stage builds for optimization
- Security scanning with Trivy
- Layer caching for faster builds
- Tagged with commit SHA for reproducibility