This guide covers deploying Dxsh using Docker and Docker Compose.
- Docker Engine 20.10+
- Docker Compose 2.0+
- 4GB+ available RAM
- 10GB+ available disk space
git clone https://github.com/yourusername/dxsh.git
cd dxshCopy the example environment files:
cp .env.example .env
cp services/workflow-engine/.env.example services/workflow-engine/.env
cp services/dashboard-service/.env.example services/dashboard-service/.env
cp services/workflow-frontend/.env.example services/workflow-frontend/.env
cp services/dashboard-frontend/.env.example services/dashboard-frontend/.envdocker-compose -f docker-compose.microservices.yml up -dThis will:
- Build all service images
- Start PostgreSQL database
- Run database migrations
- Start all microservices
- Workflow Builder: http://localhost:3000
- Dashboard: http://localhost:3001
- API Documentation: http://localhost:8001/docs
The Docker Compose setup includes:
- postgres: PostgreSQL database
- api-gateway: Central API routing (port 8001)
- workflow-engine: Workflow execution service (port 8000)
- dashboard-service: Dashboard management (port 8002)
- workflow-frontend: Workflow builder UI (port 3000)
- dashboard-frontend: Dashboard UI (port 3001)
In the root .env file:
# Database
POSTGRES_USER=workflow_user
POSTGRES_PASSWORD=workflow_password
POSTGRES_DB=workflow_engine
# Security
JWT_SECRET=your-secret-key-here
# URLs (for production, change these)
API_URL=http://localhost:8001
FRONTEND_URL=http://localhost:3000
DASHBOARD_URL=http://localhost:3001For production deployments:
- Use strong passwords:
POSTGRES_PASSWORD=strong-random-password
JWT_SECRET=long-random-secret-key- Configure external URLs:
API_URL=https://api.yourdomain.com
FRONTEND_URL=https://app.yourdomain.com
DASHBOARD_URL=https://dashboard.yourdomain.com- Enable HTTPS (use a reverse proxy like nginx)
# All services
docker-compose -f docker-compose.microservices.yml logs -f
# Specific service
docker-compose -f docker-compose.microservices.yml logs -f workflow-engine# Restart all
docker-compose -f docker-compose.microservices.yml restart
# Restart specific service
docker-compose -f docker-compose.microservices.yml restart api-gatewaydocker-compose -f docker-compose.microservices.yml down# Pull latest changes
git pull
# Rebuild and restart
docker-compose -f docker-compose.microservices.yml up -d --builddocker-compose -f docker-compose.microservices.yml exec postgres \
pg_dump -U workflow_user workflow_engine > backup.sqldocker-compose -f docker-compose.microservices.yml exec -T postgres \
psql -U workflow_user workflow_engine < backup.sql# Workflow engine migrations
docker-compose -f docker-compose.microservices.yml exec workflow-engine \
alembic upgrade head
# Dashboard service migrations
docker-compose -f docker-compose.microservices.yml exec dashboard-service \
alembic upgrade headScale individual services for better performance:
# Scale workflow engine to 3 instances
docker-compose -f docker-compose.microservices.yml up -d --scale workflow-engine=3Services include health check endpoints:
- API Gateway: http://localhost:8001/health
- Workflow Engine: http://localhost:8000/health
- Dashboard Service: http://localhost:8002/health
docker statsCheck logs for the specific service:
docker-compose -f docker-compose.microservices.yml logs service-name- Verify PostgreSQL is running:
docker-compose -f docker-compose.microservices.yml ps postgres- Check database exists:
docker-compose -f docker-compose.microservices.yml exec postgres \
psql -U workflow_user -lIf ports are already in use, either:
- Stop conflicting services
- Change ports in docker-compose.microservices.yml
If you encounter permission errors:
# Fix ownership
sudo chown -R $USER:$USER .
# Or run with sudo
sudo docker-compose -f docker-compose.microservices.yml up -d- Initialize swarm:
docker swarm init- Deploy stack:
docker stack deploy -c docker-compose.microservices.yml dxshSee the Kubernetes deployment guide (coming soon).
Example nginx configuration:
server {
listen 80;
server_name api.yourdomain.com;
location / {
proxy_pass http://localhost:8001;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}
server {
listen 80;
server_name app.yourdomain.com;
location / {
proxy_pass http://localhost:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}- Change default passwords in production
- Use HTTPS for all external traffic
- Restrict database access to internal network
- Regular backups of PostgreSQL data
- Monitor logs for suspicious activity
- Keep Docker images updated
# Update base images
docker-compose -f docker-compose.microservices.yml pull
# Rebuild with latest code
docker-compose -f docker-compose.microservices.yml up -d --buildRemove unused images and volumes:
docker system prune -a