- Add comprehensive REST API at /api/v1 with modular structure - Implement authentication endpoints (register, login, logout, me) - Add converter listing and format discovery endpoints - Create job management and file download endpoints - Add health check endpoint for monitoring - Set up CORS support for browser-based API clients - Create API middleware for JWT authentication - Add environment variables for API configuration - Include comprehensive API documentation and test script Infrastructure: - Enhanced CI/CD workflow for custom Docker registries - Docker Compose setup with dev, prod, and monitoring profiles - Claude.ai integration files for development workflow - Environment-based configuration with .env.development Known limitations: - JWT authentication context needs fixing (using ALLOW_UNAUTHENTICATED=true) - Swagger UI temporarily disabled due to composition error - File upload endpoint needs multipart/form-data support The API code is isolated in src/api/ directory to maintain separation from the existing codebase, making it easy to maintain or contribute back.
3.3 KiB
3.3 KiB
Docker Compose Configuration
This project includes both compose.yaml (original) and docker-compose.yml (enhanced) for different use cases.
Files
- compose.yaml: Original simple production deployment
- docker-compose.yml: Enhanced configuration with development, monitoring, and API features
Quick Start
Production Mode
# Using original compose file
docker compose -f compose.yaml up -d
# Using enhanced compose file (production service only)
docker compose up -d convertx
Development Mode
# Start development server with hot reload
docker compose --profile dev up convertx-dev
# Start both production and development
docker compose --profile dev up
Services
convertx (Production)
- Main application service
- Port: 3000
- Includes health checks and auto-restart
convertx-dev (Development)
- Hot reload enabled
- Port: 3001
- Mounts source code for live editing
- Profile:
dev
api-docs (API Documentation)
- Swagger UI for API documentation
- Port: 3002
- Profile:
docs
monitoring stack
- Prometheus (port 9090) and Grafana (port 3003)
- Profile:
monitoring
Profiles
Use profiles to enable optional services:
# Development only
docker compose --profile dev up
# With API documentation
docker compose --profile docs up
# With monitoring
docker compose --profile monitoring up
# Everything
docker compose --profile dev --profile docs --profile monitoring up
Environment Variables
Create a .env file for custom configuration:
# JWT Configuration
JWT_SECRET=your-secret-key-here
# API Configuration
API_ENABLED=true
API_PREFIX=/api/v1
API_RATE_LIMIT=100
API_RATE_WINDOW=15m
# Development
HTTP_ALLOWED=false
ALLOW_UNAUTHENTICATED=false
# Timezone
TZ=America/New_York
# Monitoring
GRAFANA_PASSWORD=secure-password
Development Workflow
-
Start development environment:
docker compose --profile dev up convertx-dev -
Make code changes: Edit files in
src/- they'll auto-reload -
Test production build:
docker compose up --build convertx -
View logs:
docker compose logs -f convertx-dev
Building Images
# Build all images
docker compose build
# Build specific service
docker compose build convertx
# Build with no cache
docker compose build --no-cache
Data Persistence
- Application data:
./datadirectory (mounted to/app/data) - Prometheus data:
prometheus_datavolume - Grafana data:
grafana_datavolume
Networking
All services are on the convertx-network by default. To expose services to other containers:
external_service:
networks:
- convertx-network
external_links:
- convertx
Troubleshooting
- Port conflicts: Change ports in docker-compose.yml if needed
- Permission issues: Ensure
./datadirectory has correct permissions - Build failures: Check Dockerfile and ensure all dependencies are available
- Hot reload not working: Verify volume mounts and file permissions
Production Deployment
For production, consider:
- Use specific image tags instead of
latest - Set strong JWT_SECRET
- Disable HTTP_ALLOWED and ALLOW_UNAUTHENTICATED
- Configure proper backup for data directory
- Set up monitoring with the monitoring profile
- Use external database for scale