Spaces:
Sleeping
Sleeping
Docker Setup
This directory contains Docker configuration for running the AI Image Editor API.
Quick Start
Production Mode (Default)
# Start in production mode
./run.sh prod
# Or directly with docker-compose
docker-compose up --build
Development Mode
# Start in development mode with live reloading
./run.sh dev
# Or directly with docker-compose
docker-compose -f docker-compose.dev.yml up --build
Files
Dockerfile- Production-ready Docker imagedocker-compose.yml- Production configurationdocker-compose.dev.yml- Development configuration with volume mountsrun.sh- Convenient script to switch between modes
Features
Production Mode
- Optimized for production deployment
- No volume mounts (code is baked into image)
- Health checks enabled
- Automatic restarts
Development Mode
- Live code reloading (volume mounts)
- Excluded cache directories
- Same health checks and networking
- Easy debugging
Commands
# Start services
./run.sh prod # Production
./run.sh dev # Development
# Stop services
docker-compose down
# View logs
docker-compose logs -f api
# Rebuild and start
docker-compose up --build
# Access the API
curl http://localhost:7860/health
Environment Variables
PORT- API port (default: 7860)PYTHONPATH- Python path (set in dev mode)
Health Check
The API includes a health endpoint at /health that returns:
{
"status": "healthy",
"service": "ai-image-editor-api"
}