Complete Docker deployment configuration for Chronos team task management system.
- MySQL 8.0 - Database server
- FastAPI Backend - Python backend with automatic health checks
- Angular Frontend - Production-optimized Nginx web server
- Docker Compose - One-command deployment
cd Chronos
# Copy environment file
cp .env.example .env
# Customize settings (optional)
# Edit .env file with your preferred passwords and ports# Build and start all services
docker-compose up -d --build- Frontend: http://localhost
- Backend API: http://localhost:8000
- API Documentation: http://localhost:8000/docs
- Database: localhost:3306
- Docker (version 20.10 or higher)
- Docker Compose (version 2.0 or higher)
- At least 2GB of free RAM
- At least 5GB of free disk space
# Check Docker version
docker --version
# Check Docker Compose version
docker-compose --versionCopy .env.example to .env and customize:
# Database
MYSQL_ROOT_PASSWORD=your_secure_password
MYSQL_DATABASE=chronos
MYSQL_USER=chronos
MYSQL_PASSWORD=your_secure_password
MYSQL_PORT=3306
# Backend
BACKEND_PORT=8000
# Frontend
FRONTEND_PORT=80| Service | Container Port | Host Port | Description |
|---|---|---|---|
| Frontend | 80 | 80 | Web interface |
| Backend | 8000 | 8000 | API server |
| Database | 3306 | 3306 | MySQL |
# Start all services
docker-compose up -d
# Start with build
docker-compose up -d --build
# Start specific service
docker-compose up -d backend# Stop all services
docker-compose down
# Stop and remove volumes (WARNING: deletes data!)
docker-compose down -v# View all logs
docker-compose logs -f
# View specific service logs
docker-compose logs -f backend
docker-compose logs -f frontend
docker-compose logs -f database# Restart all services
docker-compose restart
# Restart specific service
docker-compose restart backend# Check running services
docker-compose ps
# Check service health
docker-compose psAll services include health checks:
# Check health status
docker-compose ps
# Manual health checks
curl http://localhost/health
curl http://localhost:8000/healthData is persisted in Docker volumes:
- MySQL Data:
mysql_datavolume - Location:
/var/lib/docker/volumes/chronos_mysql_data/_data
# Export database
docker exec chronos-database mysqldump -u chronos -pchronos_password chronos > backup.sql
# Import database
docker exec -i chronos-database mysql -u chronos -pchronos_password chronos < backup.sql- Change default passwords in
.env - Use strong passwords (min 16 characters)
- Enable HTTPS/SSL
- Configure firewall rules
- Update CORS origins in backend
- Regular security updates
- Monitor logs for suspicious activity
For production, use a reverse proxy (Nginx, Traefik) or configure SSL:
# Example with Nginx reverse proxy
services:
nginx-proxy:
image: jwilder/nginx-proxy
ports:
- "80:80"
- "443:443"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- ./certs:/etc/nginx/certs# Check logs
docker-compose logs backend
# Verify database connection
docker-compose exec backend python -c "import pymysql; pymysql.connect(host='database', user='chronos', password='chronos_password', database='chronos')"# Check if backend is accessible
curl http://localhost:8000
# Check nginx configuration
docker exec chronos-frontend nginx -t# Check if MySQL is running
docker-compose exec database mysql -u chronos -pchronos_password -e "SELECT 1"
# Reset database (WARNING: deletes all data!)
docker-compose down -v
docker-compose up -d databaseEdit .env and change the port:
FRONTEND_PORT=8080
BACKEND_PORT=8001
MYSQL_PORT=3307# View resource usage
docker stats
# View container details
docker inspect chronos-backend# Add resource limits in docker-compose.yml
services:
backend:
deploy:
resources:
limits:
cpus: '1.0'
memory: 1G
reservations:
cpus: '0.5'
memory: 512M# Pull latest changes
git pull
# Rebuild and restart
docker-compose down
docker-compose up -d --build# Pull latest base images
docker-compose pull
# Rebuild
docker-compose up -d --build# Remove stopped containers
docker container prune
# Remove unused volumes
docker volume prune
# Remove unused images
docker image prune# Stop and remove everything
docker-compose down -v --rmi all
# Remove build cache
docker builder prunedocker-compose logs -f# MySQL CLI
docker exec -it chronos-database mysql -u chronos -pchronos_password chronos
# Or from host
mysql -h 127.0.0.1 -P 3306 -u chronos -pchronos_password chronosdocker exec -it chronos-backend bashdocker exec -it chronos-frontend sh# Initialize swarm
docker swarm init
# Deploy stack
docker stack deploy -c docker-compose.yml chronosFor Kubernetes deployment, see kubernetes/ directory (coming soon).
- Docker Documentation
- Docker Compose Documentation
- MySQL Docker Official Image
- Nginx Docker Official Image
If you encounter issues:
- Check logs:
docker-compose logs - Verify
.envconfiguration - Ensure ports are not in use
- Check Docker resource limits
- Review troubleshooting section
Back to main README