This project is now containerized with Docker for easy deployment and development.
- Docker and Docker Compose installed
- GROQ API key
# Copy the example environment file
cp env.example .env
# Edit .env and add your GROQ API key
GROQ_API_KEY=your_actual_groq_api_key_here# Build and start all services
docker-compose up --build
# Or run in detached mode
docker-compose up -d --build- Frontend: http://localhost
- Backend API: http://localhost:8004
- Health Check: http://localhost:8004/
# Build backend only
docker-compose build backend
# Build frontend only
docker-compose build frontend# Run only backend
docker-compose up backend
# Run only frontend
docker-compose up frontend# All services
docker-compose logs
# Specific service
docker-compose logs backend
docker-compose logs frontend
# Follow logs
docker-compose logs -f backend# Stop all services
docker-compose down
# Stop and remove volumes
docker-compose down -vGROQ_API_KEY: Your GROQ API key (required)HOST: Backend host (default: 0.0.0.0)PORT: Backend port (default: 8004)
- Frontend: 80 (nginx)
- Backend: 8004 (FastAPI)
┌─────────────────┐ ┌─────────────────┐
│ Frontend │ │ Backend │
│ (Nginx) │◄───┤ (FastAPI) │
│ Port: 80 │ │ Port: 8004 │
└─────────────────┘ └─────────────────┘
# Production build
docker-compose -f docker-compose.yml up -d --build
# Scale services (if needed)
docker-compose up -d --scale backend=2# Initialize swarm
docker swarm init
# Deploy stack
docker stack deploy -c docker-compose.yml ai-chatbotdocker-compose ps# Backend health
curl http://localhost:8004/
# Frontend health
curl http://localhost/docker-compose logs --tail=100 backenddocker-compose up --build --force-recreate├── backend/
│ ├── Dockerfile
│ ├── .dockerignore
│ ├── main.py
│ ├── llm.py
│ └── requirements.txt
├── frontend/
│ ├── Dockerfile
│ ├── .dockerignore
│ ├── nginx.conf
│ └── src/
├── docker-compose.yml
├── .dockerignore
└── env.example
- The application runs as non-root user in containers
- Nginx includes security headers
- Environment variables are properly isolated
- Health checks ensure service availability
- Hot reload disabled for stability
- All services in single compose file
- Basic nginx configuration
- Use production-ready nginx config
- Consider using Docker secrets for API keys
- Set up proper logging and monitoring
- Use reverse proxy (Traefik/Nginx) for SSL termination